Resizing the Gears example

SDL is killing the context on all platforms to make all platforms act
just like it does on Windows. Because of this, all SDL apps, no matter
what platform they were originally developed on and tested on,
automatically assume everything was blown away. You cannot change the
SDL API if it breaks these older apps. Period. Thats why I suggested
what I did.

hmm… so now i’m confused. are you sure sdl kills the context for all
OS’s? the gears program revived this issue because it didn’t expect the
context to be destroyed, right? when i originally brought this issue up a
while ago, i was told that different OS’s dealt with it differently so i
should expect that the opengl context might not be okay after a setvideo.
doing a quick search seems to back this up, but i’m only on windows at the
moment, so i don’t have first hand evidence of this.From: unknown@panax.com (Patrick McFarland)

Ive never looked at the gears example, but it should be effected like
any other sdl gl app. Im pretty sure that it always kills it for
consistancy sake. If Im wrong, I think Sam would have mentioned
otherwise by now :wink:

So, yes, SDL apps are supposed to always assume the opengl context was
destroyed after a setvideo, no matter what the OS can actually do.
Remember, its not hard to just destroy the opengl context and remake it
to resize, its just inefficient on platforms that can resize the current
context’s window.On 03-Jun-2004, Miles Vignol wrote:

From: “Patrick McFarland”

SDL is killing the context on all platforms to make all platforms act
just like it does on Windows. Because of this, all SDL apps, no matter
what platform they were originally developed on and tested on,
automatically assume everything was blown away. You cannot change the
SDL API if it breaks these older apps. Period. Thats why I suggested
what I did.

hmm… so now i’m confused. are you sure sdl kills the context for all
OS’s? the gears program revived this issue because it didn’t expect the
context to be destroyed, right? when i originally brought this issue up a
while ago, i was told that different OS’s dealt with it differently so i
should expect that the opengl context might not be okay after a setvideo.
doing a quick search seems to back this up, but i’m only on windows at the
moment, so i don’t have first hand evidence of this.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Patrick “Diablo-D3” McFarland || unknown at panax.com
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids, we’d
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." – Kristian Wilson, Nintendo, Inc, 1989
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040604/9d972727/attachment.pgp

Under linux, re-calling setVideoMode DOES NOT kill the context, so
textures would be loaded twice…

Under Windows it DOES destroy it.

I think that the only reason someone wants to call setVideoMode after a
resize event, is so that internall SDL mouse structures are updated (at
least under windows). If you dont call setVideoMode, then the opengl
display is correct, but when the mouse cursor exceeds the original window
size then all mouse events are lost.

It is just not efficient to have to reload EVERYTHING under windows, just
because the mouse setting are wrong. Doing the opposite would be more
optimal.On Fri, 4 Jun 2004, Patrick McFarland wrote:

Ive never looked at the gears example, but it should be effected like
any other sdl gl app. Im pretty sure that it always kills it for
consistancy sake. If Im wrong, I think Sam would have mentioned
otherwise by now :wink:

So, yes, SDL apps are supposed to always assume the opengl context was
destroyed after a setvideo, no matter what the OS can actually do.
Remember, its not hard to just destroy the opengl context and remake it
to resize, its just inefficient on platforms that can resize the current
context’s window.

On 03-Jun-2004, Miles Vignol wrote:

From: “Patrick McFarland”

SDL is killing the context on all platforms to make all platforms act
just like it does on Windows. Because of this, all SDL apps, no matter
what platform they were originally developed on and tested on,
automatically assume everything was blown away. You cannot change the
SDL API if it breaks these older apps. Period. Thats why I suggested
what I did.

hmm… so now i’m confused. are you sure sdl kills the context for all
OS’s? the gears program revived this issue because it didn’t expect the
context to be destroyed, right? when i originally brought this issue up a
while ago, i was told that different OS’s dealt with it differently so i
should expect that the opengl context might not be okay after a setvideo.
doing a quick search seems to back this up, but i’m only on windows at the
moment, so i don’t have first hand evidence of this.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Patrick “Diablo-D3” McFarland || unknown at panax.com
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids, we’d
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." – Kristian Wilson, Nintendo, Inc, 1989

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think that we, all here agree with the fact that SDL should provide a way
to avoid destroying the context when the OS gives a way to.

The real problem which is discussed for a mail or two, now, is weither or not
the good solution would be to patch the current SDL 1.2.x series or to apply
this patch to the 2.x series (which is currently under heavy development as I
can see) to avoid breaking already existing applications.

For my own, not changing the default behaviour of SDL_SetVideoMode is a good
solution, adapt it to support a specific flag for cases where the application
is aware of the new possibility is better. We could even think of a still
better solution : adding support for the detection of a special variable in
the environment for cases where the application was developed under Windows
(and tested only there) and thus have a “small inefficiency bug” under other
OS’s. This way, the user can control the behaviour at wish … even if the
source code of the application is not provided or (s)he is not a developer.

=-)

Le vendredi 4 Juin 2004 11:36, Vasileiou Nikolaos a ?crit :

Under linux, re-calling setVideoMode DOES NOT kill the context, so
textures would be loaded twice…

Under Windows it DOES destroy it.

I think that the only reason someone wants to call setVideoMode after a
resize event, is so that internall SDL mouse structures are updated (at
least under windows). If you dont call setVideoMode, then the opengl
display is correct, but when the mouse cursor exceeds the original window
size then all mouse events are lost.

It is just not efficient to have to reload EVERYTHING under windows, just
because the mouse setting are wrong. Doing the opposite would be more
optimal.

Ive never looked at the gears example, but it should be effected like
any other sdl gl app. Im pretty sure that it always kills it for
consistancy sake. If Im wrong, I think Sam would have mentioned
otherwise by now :wink:

So, yes, SDL apps are supposed to always assume the opengl context was
destroyed after a setvideo, no matter what the OS can actually do.
Remember, its not hard to just destroy the opengl context and remake it
to resize, its just inefficient on platforms that can resize the current
context’s window.

SDL is killing the context on all platforms to make all platforms act
just like it does on Windows. Because of this, all SDL apps, no matter
what platform they were originally developed on and tested on,
automatically assume everything was blown away. You cannot change the
SDL API if it breaks these older apps. Period. Thats why I suggested
what I did.

hmm… so now i’m confused. are you sure sdl kills the context for all
OS’s? the gears program revived this issue because it didn’t expect
the context to be destroyed, right? when i originally brought this
issue up a while ago, i was told that different OS’s dealt with it
differently so i should expect that the opengl context might not be
okay after a setvideo. doing a quick search seems to back this up, but
i’m only on windows at the moment, so i don’t have first hand evidence
of this.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Patrick “Diablo-D3” McFarland || unknown at panax.com
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids,
we’d all be running around in darkened rooms, munching magic pills and
listening to repetitive electronic music." – Kristian Wilson, Nintendo,
Inc, 1989


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Michel Nolard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAwEbQyAKwOMHoSb0RAkOvAKDFPBguawz6pJMqUG/ZKDGL+HN4eACaAq25
9kXzS/R7vmHzzscOPibeNUY=
=e+Vp
-----END PGP SIGNATURE-----> On Fri, 4 Jun 2004, Patrick McFarland wrote:

On 03-Jun-2004, Miles Vignol wrote:

From: “Patrick McFarland”

The real problem which is discussed for a mail or two, now, is weither or
not
the good solution would be to patch the current SDL 1.2.x series or to
apply
this patch to the 2.x series (which is currently under heavy development as
I
can see) to avoid breaking already existing applications.

For my own, not changing the default behaviour of SDL_SetVideoMode is a
good
solution, adapt it to support a specific flag for cases where the
application
is aware of the new possibility is better. We could even think of a still
better solution : adding support for the detection of a special variable in
the environment for cases where the application was developed under Windows
(and tested only there) and thus have a “small inefficiency bug” under
other
OS’s. This way, the user can control the behaviour at wish … even if the
source code of the application is not provided or (s)he is not a developer.

or a “resizevideo” function that is a more appropriate function call when
you’re simply resizing the window. takes only two values (x and y
resolution) instead of the additional bpp and flags (since the assumption is
these are not changing).

there are plenty of good solutions, but to be honest, i’m affraid they’ll
all get wrapped into sdl 2.x or be debated for months (flag to setvideo?
new function? env variable?). i understand why design features are need to
be debated – i’m all for careful consideration of the API. i was just
hoping to frame the problem as a bug rather than a design feature. bug
fixes that break old functionality are just the breaks.

i’m glad this issue is finally getting some traction, tho. i brought it up
months ago and it just sorta fizzled. sam recently made mention of patches
being accepted regarding the mouse rect structure, so maybe the point will
be moot soon…From: michel.nolard@outmax.org (Michel Nolard)

Under linux, re-calling setVideoMode DOES NOT kill the context, so
textures would be loaded twice…

Under Windows it DOES destroy it.

Since when? Unless Ive completely missed something, it does destroy
the context, or something equivilent. Go setup a test case, where you
resize the window via setVideoMode, and try to use a previously set
texture, it wont work.

I think that the only reason someone wants to call setVideoMode after a
resize event, is so that internall SDL mouse structures are updated (at
least under windows). If you dont call setVideoMode, then the opengl
display is correct, but when the mouse cursor exceeds the original window
size then all mouse events are lost.

It is just not efficient to have to reload EVERYTHING under windows, just
because the mouse setting are wrong. Doing the opposite would be more
optimal.

Hrm, if the opengl display is resized correctly, and SDL sends the
resize event… then why doesnt SDL just do it automatically? I cant
think of any case where this would break older apps.On 04-Jun-2004, Vasileiou Nikolaos wrote:


Patrick “Diablo-D3” McFarland || unknown at panax.com
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids, we’d
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." – Kristian Wilson, Nintendo, Inc, 1989
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040604/6b467d4d/attachment.pgp

Its hard to do that. SDL_SetVideoMode needs to always destroy the
context, because this is what apps expect. I think I maybe we just need
two things, and this would be the most optimial case: A flag and a
function. The flag would be a flag that you pass to SDL_SetVideoMode,
SDL_OPENGL_NEW_RESIZEABLE, and the function would be SDL_GL_Remap_Mouse,
which only accepts h and w values.

I really wish Sam would comment on this, since he knows the insides of
SDL better than we do. Sam, where are you!?On 04-Jun-2004, Michel Nolard wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think that we, all here agree with the fact that SDL should provide a way
to avoid destroying the context when the OS gives a way to.

The real problem which is discussed for a mail or two, now, is weither or not
the good solution would be to patch the current SDL 1.2.x series or to apply
this patch to the 2.x series (which is currently under heavy development as I
can see) to avoid breaking already existing applications.

For my own, not changing the default behaviour of SDL_SetVideoMode is a good
solution, adapt it to support a specific flag for cases where the application
is aware of the new possibility is better. We could even think of a still
better solution : adding support for the detection of a special variable in
the environment for cases where the application was developed under Windows
(and tested only there) and thus have a “small inefficiency bug” under other
OS’s. This way, the user can control the behaviour at wish … even if the
source code of the application is not provided or (s)he is not a developer.

=-)


Patrick “Diablo-D3” McFarland || unknown at panax.com
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids, we’d
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." – Kristian Wilson, Nintendo, Inc, 1989
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040604/53cb8b39/attachment.pgp