| [SDL2] Resize issues |
| [SDL2] Resize issues |
|
Sik
|
I think you're supposed to repaint on resizing always since the
display contents aren't guaranteed to be there anymore. If they stay there it's pure coincidence and you shouldn't rely on it. 2013/3/17, Flamaros:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
|
||||||||||||||
| Re: [SDL2] Resize issues |
|
Flamaros
|
Yes I had try to force repaint, by calling explicitly my draw method on resize event with no effect. I know it's necessary to do it with win32 API. I really need that feature as I am not doing a game. |
|||||||||||||||
|
|
||||||||||||||||
| [SDL2] Resize issues |
|
Gabriele Greco
Guest
|
I'm quite sure yoy don't need to redraw on the resize event, I think it's enough to redraw on the SDL_WINDOWEVENT_EXPOSE that you'll receive once the resize is occurred. You have to use the resize event (SDL_WINDOWEVENT_RESIZED) only to get your new surface size. -- Ing. Gabriele Greco, DARTS Engineering Tel: +39-0100980150 Fax: +39-0100980184 s-mail: Piazza Della Vittoria 9/3 - 16121 GENOVA (ITALY) |
|||||||||||||
|
|
||||||||||||||
| Re: [SDL2] Resize issues |
|
Flamaros
|
Add a draw call on SDL_WINDOWEVENT_EXPOSE event don't change anything. You may notice I am using Opengl and after the SDL_PollEvent loop I always call my draw method. |
|||||||||||||||
|
|
||||||||||||||||
| [SDL2] Resize issues |
|
Jonny D
|
Maybe try to draw, swap buffers, then draw again? If disabling double-buffering helped, then this is probably what you need to do.
Jonny D On Mon, Mar 18, 2013 at 3:14 PM, Flamaros wrote:
|
|||||||||||||
|
|
||||||||||||||
| [SDL2] Resize issues |
|
Forest Hale
Guest
|
Don't forget to call glViewport also, with the new size.
On 03/18/2013 12:21 PM, Jonathan Dearborn wrote:
-- LordHavoc Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces Co-designer of Nexuiz - http://alientrap.org/nexuiz "War does not prove who is right, it proves who is left." - Unknown "Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass "A game is a series of interesting choices." - Sid Meier _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
|
||||||||||||||
| Re: [SDL2] Resize issues |
|
Flamaros
|
Certainly, for the moment I call glViewport each frame.
|
|||||||||||||||
|
|
||||||||||||||||
|
Flamaros
|
I am back on this particular issue since I made progress on other primary parts.
I add some outputs to be able to understand what is happening. While I am resizing the window I don't get the "SDL_PollEvent" text in the console, it's only when I release the mouse button that all "SDL_WINDOWEVENT_RESIZED" messages are printed. For the move event I receive only once when I release the mouse button. Here is my loop code :
|
|||||||||||||
|
|
||||||||||||||
|
Nathaniel J Fries
|
On Windows, DispatchMessage() enters into a loop for as long as you're holding down the mouse button when you begin resizing your window.
Within the framework of the SDL API, there is no correction*. It would require rendering within the Window Procedure, which is impossible. On Linux, it seems to be an issue of X11 destroying the OpenGL buffer contents during resize, which means it is probably not something that a client program can control or properly account for. I've never seen a program using OpenGL for graphics on Linux resize without some flickering. * - Shy of some sort of mechanism to jump out of the Windows Procedure and then back in again as if no jump had occurred, such as maybe a Fiber or explicit context switching, but this would probably cause some issues too. |
|||||||||||
|
|
||||||||||||
|
Flamaros
|
I don't have issue like that with DispatchMessage(). Currently I am using SDL under Windows, because I try to share the maximum code between platforms. My application loop :
The Wndproc function :
With this code "WM_SIZE" is printed during the window resize not only when I release the mouse button. |
|||||||||||||||||
|
|
||||||||||||||||||
|
Flamaros
|
You may have a look to the answer 2 of this stackoverflow question :
http://stackoverflow.com/questions/3102074/win32-my-application-freezes-while-the-user-resizes-the-window |
|||||||||||
|
|
||||||||||||

