static void SW_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) { if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { SDL_SW_DestroyYUVTexture((SDL_SW_YUVTexture *) texture->driverdata); } else { SDL_Surface *surface = (SDL_Surface *) texture->driverdata; SDL_FreeSurface(surface); } }
static void D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) { D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; if (!data) { return; } if (data->yuv) { SDL_SW_DestroyYUVTexture(data->yuv); } if (data->texture) { IDirect3DTexture9_Release(data->texture); } SDL_free(data); texture->driverdata = NULL; }
static void GDI_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) { GDI_TextureData *data = (GDI_TextureData *) texture->driverdata; if (!data) { return; } if (data->yuv) { SDL_SW_DestroyYUVTexture(data->yuv); } if (data->hpal) { DeleteObject(data->hpal); } if (data->hbm) { DeleteObject(data->hbm); } SDL_free(data); texture->driverdata = NULL; }
static void X11_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) { X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; X11_TextureData *data = (X11_TextureData *) texture->driverdata; if (!data) { return; } if (data->yuv) { SDL_SW_DestroyYUVTexture(data->yuv); } if (data->pixmap != None) { XFreePixmap(renderdata->display, data->pixmap); } if (data->image) { data->image->data = NULL; XDestroyImage(data->image); } #ifndef NO_SHARED_MEMORY if (data->shminfo.shmaddr) { XShmDetach(renderdata->display, &data->shminfo); XSync(renderdata->display, False); shmdt(data->shminfo.shmaddr); data->pixels = NULL; } #endif if (data->scaling_image) { SDL_free(data->scaling_image->data); data->scaling_image->data = NULL; XDestroyImage(data->scaling_image); } if (data->pixels) { SDL_free(data->pixels); } SDL_free(data); texture->driverdata = NULL; }