The problem here is that the app fails with “Bus Error”. I’ve hunted it down to
the SDL_SetVideoMode call i.e. if I remove the call, it resizes successfully
but naturally it doesn’t draw what I need(although
it does draw because I call drawGLScene() from here).
Any idea what the problem is?
And just an additional question - is it normal that when I resize the
window it also gets centered?
And just an additional question - is it normal that when I resize the
window it also gets centered?
Nope, are you using SDL 1.2.13?
As far as I know that is indeed normal, also in 1.2.13. IIRC
SDL_SetVideoMode() completely destroys and recreates the window, causing
it to be re-centered.
The problem here is that the app fails with “Bus Error”.
Have you tried running it under the debugger?
Yes, as I see(I haven’t used SDL sources) it doesn’t crash in
SDL_SetVideoMode but after return 1…
What happens as I see it: when I use SDL_PollEvent then SDL_VIDEORESIZE
gets posted to internal queue only when the button is released - so no
dynamic resizing - is it intended behaviour? By resorting to
event filter I hack the code by catching all the SDL_VideoResize messages
and handling it on my own. Or maybe the eventFilter handler is in another
thread, and the thread with the main loop gets paused when dragging…
If I remove the call to SDL_SetVideoMode from eventFilter handler the
window gets redrawn but I see garbage outside the original window, if
I don’t use eventFilter at all then the window
just blanks during resizing.
What I actually want to do is that the window gets redrawn during
resizing - the way it’s done in glut
for example. Or is it intended that it doesn’t get redrawn?
And just an additional question - is it normal that when I resize the
window it also gets centered?
Nope, are you using SDL 1.2.13?
Yes, 1.2.13… I’ve built it unix way(autogen.sh configure make make install)
with --without-x --disable-x11-video
Yes, I’ve read that setVideoMode recreates the window that’s why it gets
centered so I thought it was default behaviour.
Maybe I should compile from SVN…> See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment
And just an additional question - is it normal that when I resize the
window it also gets centered?
Nope, are you using SDL 1.2.13?
As far as I know that is indeed normal, also in 1.2.13. IIRC
SDL_SetVideoMode() completely destroys and recreates the window, causing
it to be re-centered.
I just tested it with testwm -resize and it didn’t recenter the window
during or after resize… ?
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment
What happens as I see it: when I use SDL_PollEvent then SDL_VIDEORESIZE
gets posted to internal queue only when the button is released - so no
dynamic resizing - is it intended behaviour? By resorting to
event filter I hack the code by catching all the SDL_VideoResize messages
and handling it on my own. Or maybe the eventFilter handler is in another
thread, and the thread with the main loop gets paused when dragging…
Yes, I believe the documentation states that you should never call SDL
video API functions from the event filter thread. It may be called from
another thread or from a hardware interrupt.
Instead you should either send another SDL event or set a global variable
or use some other messaging system to notify anyone who cares.
See ya,
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment
Yes, I believe the documentation states that you should never call SDL
video API functions from the event filter thread. It may be called from
another thread or from a hardware interrupt.
Instead you should either send another SDL event or set a global variable
or use some other messaging system to notify anyone who cares.
See ya,
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment
I think that’s what I get from using code hacks
So is there a standard way to do dynamic resizing(redrawing during resize)?
As far as I know that is indeed normal, also in 1.2.13. IIRC
SDL_SetVideoMode() completely destroys and recreates the window, causing
it to be re-centered.
I just tested it with testwm -resize and it didn’t recenter the window
during or after resize… ?
You’re right, it only does that in OpenGL mode (and a few other special
cases). See SDL_QuartzVideo.m:666. I missed that because the OpenGL case
is the only one I’m familiar with.
I just tested it with testwm -resize and it didn’t recenter the window
during or after resize… ?
You’re right, it only does that in OpenGL mode (and a few other special
cases). See SDL_QuartzVideo.m:666. I missed that because the OpenGL case
is the only one I’m familiar with.
-Christian
Hm, but if I don’t change the GL attributes, can I force it not to be destroyed?
Apart from hacking the source code of SDL