static int D3D_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch) { D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; if (data->yuv) { return SDL_SW_QueryYUVTexturePixels(data->yuv, pixels, pitch); } else { /* D3D textures don't have their pixels hanging out */ return -1; } }
static int X11_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch) { X11_TextureData *data = (X11_TextureData *) texture->driverdata; if (data->yuv) { return SDL_SW_QueryYUVTexturePixels(data->yuv, pixels, pitch); } else { *pixels = data->pixels; *pitch = data->pitch; return 0; } }
static int SW_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch) { if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { return SDL_SW_QueryYUVTexturePixels((SDL_SW_YUVTexture *) texture->driverdata, pixels, pitch); } else { SDL_Surface *surface = (SDL_Surface *) texture->driverdata; *pixels = surface->pixels; *pitch = surface->pitch; return 0; } }