Hi all,
I have the following problem that I can’t resolve:
My Linux App uses SDL to make a window for OpenGL (as substitute for GLUT I
think… Also I need sound in the future…) To set the video mode I use:
(void)SDL_SetVideoMode(vmResX, vmResY, vmBPP, flags);
with “flags” being SDL_OPENGL and (if fullscreen SDL_FULLSCREEN as well).
This works fine in Linux and in MS-Windows (2000) it works as well. Graphics,
textures all renders perfectly. Fullscreen / Windowed mode, no matter.
PROBLEM:
Ok, now I want to change resolution. In Linux I just call SDL_SetVideoMode
again and the OpenGL function glViewport. It works without problems.
In Windows everything goes black!!! Even if I reload all textures, nothing
happens! App is still running though…
And I mean black. totally black. This even happens when a user “changes” to
the same resolution again. Fullscreen / Windowed makes no diff.
Why needs ms-windows this extra hand-holding? What am I missing? Do I need to
call some extra SDL function? OpenGL? Win32?
[Note: vmBPP is allways set to the current desktop resolution]
[Note2: Please be gentle, as I don’t program in ms-windows.]
[Note3: I am known to make silly mistakes
Maybe I missed something
"obvious"]
Thanks in advance,
Florian
Florian,
I had the same problem a few weeks ago, and it turned out that I was placing
all my geometry (except my bitmap font) into a displayList. When the window
resize occurs, the OpenGL context gets destroyed and recreated- hence the
need to reload all the textures, but that was not enough! All the
displayLists needed to be recreated too along with a complete
reinitialization of all my OpenGL settings. Once I made sure to do that,
everything worked fine.
I hope that helps.
-Blake> ----- Original Message -----
From: ma1flfs@bath.ac.uk (Florian Schanda)
To:
Sent: Thursday, June 06, 2002 8:49 AM
Subject: [SDL] Problem with ms-windows + opengl…
Hi all,
I have the following problem that I can’t resolve:
My Linux App uses SDL to make a window for OpenGL (as substitute for GLUT I
think… Also I need sound in the future…) To set the video mode I use:
(void)SDL_SetVideoMode(vmResX, vmResY, vmBPP, flags);
with “flags” being SDL_OPENGL and (if fullscreen SDL_FULLSCREEN as well).
This works fine in Linux and in MS-Windows (2000) it works as well.
Graphics,
textures all renders perfectly. Fullscreen / Windowed mode, no matter.
PROBLEM:
Ok, now I want to change resolution. In Linux I just call SDL_SetVideoMode
again and the OpenGL function glViewport. It works without problems.
In Windows everything goes black!!! Even if I reload all textures, nothing
happens! App is still running though…
And I mean black. totally black. This even happens when a user “changes” to
the same resolution again. Fullscreen / Windowed makes no diff.
Why needs ms-windows this extra hand-holding? What am I missing? Do I need
to
call some extra SDL function? OpenGL? Win32?
[Note: vmBPP is allways set to the current desktop resolution]
[Note2: Please be gentle, as I don’t program in ms-windows.]
[Note3: I am known to make silly mistakes
Maybe I missed something
"obvious"]
Thanks in advance,
Florian
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
Florian Schanda wrote:
Hi all,
I have the following problem that I can’t resolve:
My Linux App uses SDL to make a window for OpenGL (as substitute for GLUT I
think… Also I need sound in the future…) To set the video mode I use:
(void)SDL_SetVideoMode(vmResX, vmResY, vmBPP, flags);
with “flags” being SDL_OPENGL and (if fullscreen SDL_FULLSCREEN as well).
This works fine in Linux and in MS-Windows (2000) it works as well. Graphics,
textures all renders perfectly. Fullscreen / Windowed mode, no matter.
PROBLEM:
Ok, now I want to change resolution. In Linux I just call SDL_SetVideoMode
again and the OpenGL function glViewport. It works without problems.
In Windows everything goes black!!! Even if I reload all textures, nothing
happens! App is still running though…
And I mean black. totally black. This even happens when a user “changes” to
the same resolution again. Fullscreen / Windowed makes no diff.
Why needs ms-windows this extra hand-holding? What am I missing? Do I need to
call some extra SDL function? OpenGL? Win32?
[Note: vmBPP is allways set to the current desktop resolution]
[Note2: Please be gentle, as I don’t program in ms-windows.]
[Note3: I am known to make silly mistakes
Maybe I missed something
"obvious"]
Thanks in advance,
Florian
My program can’t change resolutions during runtime (only because I
didn’t put code to do that…), it just can switch between fullscreen
and windowed mode. And if I switch to windowed mode, the same happens to
me too. The screen goes black or gets corrupted (any drawing to it by
Windows after that is also corrupted).
The only way I can restore it is to fast-switch to another user and back
(in Windows XP, using PowerToys for XP). Don’t know why it happens
thought…
I have a 3dfx Voodo3 card. A super defective driver for it came with
Windows, I found a good one, but it still happens.
What do you have?
RK.
Blake Senftner wrote:
Florian,
I had the same problem a few weeks ago, and it turned out that I was placing
all my geometry (except my bitmap font) into a displayList. When the window
resize occurs, the OpenGL context gets destroyed and recreated- hence the
need to reload all the textures, but that was not enough! All the
displayLists needed to be recreated too along with a complete
reinitialization of all my OpenGL settings. Once I made sure to do that,
everything worked fine.
I hope that helps.
-Blake
Hmmmmm… some very important info… :)) 10q!
It just might be that some problems I have could be solved by this.
I’ll go and add my texture-loading and display-list-compiling procedure
to the opengl-size-change-event (or in short, I’ll add a call to
"InitGL" in “ResizeWindow”…
).
RK.
I actually didnt test this, my brother did. He has a GF2 and win2k. Nvidia’s
drivers a said to be one of the best though.
I only have Linux, and with that I don’t have the problem at all, thats why
I’m so confused. (GF2 card as well.)On Thursday 06 June 2002 18:00, Romi Kuntsman wrote:
I have a 3dfx Voodo3 card. A super defective driver for it came with
Windows, I found a good one, but it still happens.
What do you have?
Thanks for the info.
However I don’t use any displaylists, compiled vertex arrays or anyhing else.
Only textures, and they get reloaded.
(BTW, I don’t handle resize events… You can’t resize my window. But you
eventually will have a videomode selection inside the game as it is sortof
designed for fullscreen)
Maybe the rendering-context gets fscked upon SDL_SetVideoMode and
SDL_SetVideoMode doesn’t assign one?
How would I assign a new rendering context without shutting down SDL? (In a
crossplatform way?)
Is this a SDL bug on win32 perhaps?
Thanks,
FlorianOn Thursday 06 June 2002 18:24, Romi Kuntsman wrote:
Blake Senftner wrote:
Florian,
I had the same problem a few weeks ago, and it turned out that I was
placing all my geometry (except my bitmap font) into a displayList. When
the window resize occurs, the OpenGL context gets destroyed and recreated-
hence the need to reload all the textures, but that was not enough! All
the
displayLists needed to be recreated too along with a complete
reinitialization of all my OpenGL settings. Once I made sure to do that,
everything worked fine.
I hope that helps.
-Blake
Hmmmmm… some very important info… :)) 10q!
It just might be that some problems I have could be solved by this.
I’ll go and add my texture-loading and display-list-compiling procedure
to the opengl-size-change-event (or in short, I’ll add a call to
"InitGL" in “ResizeWindow”…
).
Indeed. The suggestion I would give (and what I use in anything I write
myself) is that you break out video init/shutdown from the rest of your
init/shutdown code. Every part of your renderer should probably have init
and shutdown functions, even if they start out empty. When you want to
apply resolution changes, shut down everything related to video and start
it all up again.
GLUT contains code to workaround this for both Win32 and X11 AFAIK.On Thu, Jun 06, 2002 at 10:01:04AM -0700, Blake Senftner wrote:
I had the same problem a few weeks ago, and it turned out that I was placing
all my geometry (except my bitmap font) into a displayList. When the window
resize occurs, the OpenGL context gets destroyed and recreated- hence the
need to reload all the textures, but that was not enough! All the
displayLists needed to be recreated too along with a complete
reinitialization of all my OpenGL settings. Once I made sure to do that,
everything worked fine.
I hope that helps.
–
Joseph Carter Sooner or later, BOOM!
“This is the element_data structure for elements whose *element_type =
FORM_TYPE_SELECT_ONE, FORM_TYPE_SELECT_MULT. / / * nesting deeper
and deeper, harder and harder, go, go, oh, OH, OHHHHH!! * Sorry, got
carried away there. */ struct lo_FormElementOptionData_struct.”
– Mozilla source code
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020606/241e1f39/attachment.pgp
However I don’t use any displaylists, compiled vertex arrays or anyhing
else.
Only textures, and they get reloaded.
(BTW, I don’t handle resize events… You can’t resize my window. But you
eventually will have a videomode selection inside the game as it is sortof
designed for fullscreen)
Maybe the rendering-context gets fscked upon SDL_SetVideoMode and
SDL_SetVideoMode doesn’t assign one?
How would I assign a new rendering context without shutting down SDL? (In a
crossplatform way?)
Florian,
It is SDL_SetVideoMode( width, height, 0, flags ), where flags has the
SDL_OPENGL bit set, that creates the OpenGL context. If on OpenGL context
already exists then the existing OpenGL context is destroyed and a new one
is created. So, every time that SetVideoMode() is called, you need to make
sure that the OPENGL bit is set and that you reload all your textures and
assign them new texture object ids.
-Blake