We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reported in version: 2.0.4 Reported for operating system, platform: Linux, x86_64
On 2018-06-20 06:48:54 +0000, Adam Bryant wrote:
In this sample code: #include #include <SDL2/SDL.h> #include int main() { SDL_Window *window = NULL; SDL_Renderer *renderer = NULL; SDL_CreateWindowAndRenderer(1, 1, 0, &window, &renderer); SDL_Texture *texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STATIC, 1, 1); SDL_SetRenderTarget(renderer, texture); SDL_Texture *renderTexture = SDL_GetRenderTarget(renderer); if (renderTexture != texture) { throw std::runtime_error("What?"); } std::this_thread::sleep_for(std::chrono::seconds(1)); return 0; } the exception is thrown. Is SDL_GetRenderTarget returning a different address expected behavior?
In this sample code:
#include #include <SDL2/SDL.h> #include
int main() { SDL_Window *window = NULL; SDL_Renderer *renderer = NULL; SDL_CreateWindowAndRenderer(1, 1, 0, &window, &renderer);
SDL_Texture *texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STATIC, 1, 1); SDL_SetRenderTarget(renderer, texture); SDL_Texture *renderTexture = SDL_GetRenderTarget(renderer); if (renderTexture != texture) { throw std::runtime_error("What?"); } std::this_thread::sleep_for(std::chrono::seconds(1)); return 0;
}
the exception is thrown.
Is SDL_GetRenderTarget returning a different address expected behavior?
On 2018-06-22 17:45:29 +0000, Sam Lantinga wrote:
Yes, this is expected if you're using a texture format that isn't supported by the renderer. Try using SDL_PIXELFORMAT_ARGB8888 instead if you don't want texture conversion.
Yes, this is expected if you're using a texture format that isn't supported by the renderer.
Try using SDL_PIXELFORMAT_ARGB8888 instead if you don't want texture conversion.
On 2018-06-22 21:17:25 +0000, Adam Bryant wrote:
(In reply to Sam Lantinga from comment # 1) Yes, this is expected if you're using a texture format that isn't supported by the renderer. Try using SDL_PIXELFORMAT_ARGB8888 instead if you don't want texture conversion. Thanks, it works now. I changed my code around to select a supported format.
(In reply to Sam Lantinga from comment # 1)
Thanks, it works now. I changed my code around to select a supported format.
On 2019-06-10 18:44:46 +0000, Martin Vee wrote:
This behaviour should be described in the wiki, as it's a bit unexpected to have a "getter" returning a different value than the "setter". Is it possible to query a texture->native pointer to get it's parent texture pointer?
This behaviour should be described in the wiki, as it's a bit unexpected to have a "getter" returning a different value than the "setter".
Is it possible to query a texture->native pointer to get it's parent texture pointer?
texture->native
texture
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This bug report was migrated from our old Bugzilla tracker.
Reported in version: 2.0.4
Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2018-06-20 06:48:54 +0000, Adam Bryant wrote:
On 2018-06-22 17:45:29 +0000, Sam Lantinga wrote:
On 2018-06-22 21:17:25 +0000, Adam Bryant wrote:
On 2019-06-10 18:44:46 +0000, Martin Vee wrote:
The text was updated successfully, but these errors were encountered: