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 - Window size is returning a wrong value in max resolution
Summary: Window size is returning a wrong value in max resolution
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.12
Hardware: x86 Windows 10
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-06 01:00 UTC by Lísias de Castro
Modified: 2020-05-06 01:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;
...