We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5124

Summary: Window size is returning a wrong value in max resolution
Product: SDL Reporter: Lísias de Castro <saisilcastro>
Component: videoAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.12   
Hardware: x86   
OS: Windows 10   

Description Lísias de Castro 2020-05-06 01:00:41 UTC
When I used my function to get a resolution I saved it into file. Before to get into the event loop the resolution was correct, but when the loop came into SDL_WINDOWEVENT_RESIZED and I updated my screen width and height through event.window.data. The problem is the data2 came with the wrong value.

here is my event code piece:

...
case SDL_WINDOWEVENT_RESIZED:
                {
                    machine->width = SDL_C(machine->plugin)->event.window.data1;
                    machine->height = SDL_C(machine->plugin)->event.window.data2;
                    SDL_IMAGE_SET * image = (SDL_IMAGE_SET*) map->of->image;
                    if (image && image->memory) {
                        B32 width, height;
                        SDL_QueryTexture(image->memory, NULL, NULL, &width, &height);
                        map->width = (BP32) width;
                        map->height = (BP32) height;
                    }
                }
                    break;
...