Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
104 user(s) are online (89 user(s) are browsing Forums)

Members: 0
Guests: 104

more...

Support us!

Headlines

Report message:*
 

Re: SDL2

Subject: Re: SDL2
by kas1e on 2021/4/5 9:36:55

@Capehill

Find out some issue (about which we discuss in mails before) about some game where things messed up when we change window-resolutions.

I find out it that this in end about those 2 lines of code:

Quote:

SDL_SetWindowSize(m_Window, Width, Height);
SDL_SetWindowPosition(m_Window, SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED);


That combo works as expected on Linux/win32, but on our side, things messed up (window sets wrong). And solution there is to add some Delay (even IDOS->Delay(5) is ok) between those calls to make all works as expected.

Imho, that point out to us (i hope), that SDL_SetWindowPosition is too fast and didn't check if SDL_SetWindowSize finished, and the second command executed too fast leading to a mess.

I can fast-fix it in code by adding Delay(5) for example which visually will be unnoticed, or something, but isn't it something we need to add to the SDL_SetWindowSize (like, until it not done, we didn't do anything else). Or to the SDL_SetWindowPosition to see if all other SDL operation about window is done firstly and only then do call.

Taking into account that this code works as expected on other platforms, maybe indeed worth checking in SDL itself?

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project