| Summary: | SDL_RenderSetLogicalSize stretches render with SDL_WINDOW_ALLOW_HIGHDPI when window is resized and moved | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Diego <diegoacevedo91> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | WAITING --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X 10.8 | ||
This should be fixed with the latest SDL snapshot, can you please confirm? http://www.libsdl.org/tmp/SDL-2.0.zip No this is still not fixed with the latest commit. |
When a window is created with SDL_WINDOW_ALLOW_HIGHDPI and SDL_RenderSetLogicalSize is set on the renderer, resizing the window changes the scale and letterboxing correctly, but if the window is then dragged and moved, the letterbox disappears and the renderer is stretched to the window size. The following test code produces the stretching for me. Removing SDL_WINDOW_ALLOW_HIGHDPI from the window flags produces no stretching. ////CODE #include <stdio.h> #include "SDL.h" int main(int argc, char *argv[]) { if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { printf("Could not initialize SDL\n"); return 1; } SDL_Window *window = SDL_CreateWindow("Title", 100,100,100,100, SDL_WINDOW_SHOWN|SDL_WINDOW_RESIZABLE|SDL_WINDOW_ALLOW_HIGHDPI); SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0); SDL_RenderSetLogicalSize(renderer, 100,100); SDL_bool running = SDL_TRUE; while (running) { SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderClear(renderer); SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); SDL_RenderFillRect(renderer, NULL); SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); SDL_RenderFillRect(renderer, &(SDL_Rect){0,0,50,50}); SDL_RenderPresent(renderer); SDL_Event event; while (SDL_PollEvent(&event)) { if (event.type == SDL_QUIT) { running = SDL_FALSE; break; } } SDL_Delay(100); } return 0; }