OpenGL window won't show after 'restart'

Context:
[SDL 1.2.7]
[Win2k]
[OpenGL window]

Hi, I’m having a problem with the “apply video resolution” option in my
program. I want to be able to change the video resolution (and the
fullscreen/windowed option) “in-game”. I therefor have a very simply,
but effective loop:

do {
	init();
	intro();
	run();
	outro();
	done();
} while (g_perform_restart);

g_perform_restart is set to true when a video resolution change is
needed. When I’m in window mode and I change the “resolution” of the
window, this loop works just fine. When I’m in window mode and change to
some fullscreen resolution, it works just fine. But when I’m in
fullscreen mode and I want to change to some window mode, the problem
occurs.
The video window is created (I see a window button in my taskbar), but
it’s minimized into some sort of very strange state, because I can’t get
it to appear at all. My application does not crash, it responds to
messages and debugging the application goes just fine, the window just
doesn’t appear.

I’ve tried the following:

  • I tried to force it to be visible by calling the Win32 API function
    ShowWindow(HWND, SW_NORMAL), no effect at all.
  • I added a sleep of 5 seconds before re-initing the application (I
    figured that maybe the driver doesn’t like to create a video window
    directly after having been in fullscreen? Heck I don’t know :-)), no
    effect at all.

Does anyone have any ideas?

Thanks in advance!

Marc

Is there nobody who can help me with this?
Marc

M.A. Oude Kotte wrote:> Context:

[SDL 1.2.7]
[Win2k]
[OpenGL window]

Hi, I’m having a problem with the “apply video resolution” option in my
program. I want to be able to change the video resolution (and the
fullscreen/windowed option) “in-game”. I therefor have a very simply,
but effective loop:

do {
    init();
    intro();
    run();
    outro();
    done();
} while (g_perform_restart);

g_perform_restart is set to true when a video resolution change is
needed. When I’m in window mode and I change the “resolution” of the
window, this loop works just fine. When I’m in window mode and change to
some fullscreen resolution, it works just fine. But when I’m in
fullscreen mode and I want to change to some window mode, the problem
occurs.
The video window is created (I see a window button in my taskbar), but
it’s minimized into some sort of very strange state, because I can’t get
it to appear at all. My application does not crash, it responds to
messages and debugging the application goes just fine, the window just
doesn’t appear.

I’ve tried the following:

  • I tried to force it to be visible by calling the Win32 API function
    ShowWindow(HWND, SW_NORMAL), no effect at all.
  • I added a sleep of 5 seconds before re-initing the application (I
    figured that maybe the driver doesn’t like to create a video window
    directly after having been in fullscreen? Heck I don’t know :-)), no
    effect at all.

Does anyone have any ideas?

Thanks in advance!

Marc


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

I remember someone mentioning this to me on IRC. The problem seems to
be that SDL destroys
the entire OpenGL Context when the resolution changes, or when switching
from window to
fullscreen. I am unsure of how to solve this, since I don’t work with
OpenGL, but I hope this
helps you.

M.A. Oude Kotte wrote:> Is there nobody who can help me with this?

Marc

M.A. Oude Kotte wrote:

Context:
[SDL 1.2.7]
[Win2k]
[OpenGL window]

Hi, I’m having a problem with the “apply video resolution” option in
my program. I want to be able to change the video resolution (and the
fullscreen/windowed option) “in-game”. I therefor have a very simply,
but effective loop:

do {
    init();
    intro();
    run();
    outro();
    done();
} while (g_perform_restart);

g_perform_restart is set to true when a video resolution change is
needed. When I’m in window mode and I change the “resolution” of the
window, this loop works just fine. When I’m in window mode and change
to some fullscreen resolution, it works just fine. But when I’m in
fullscreen mode and I want to change to some window mode, the problem
occurs.
The video window is created (I see a window button in my taskbar),
but it’s minimized into some sort of very strange state, because I
can’t get it to appear at all. My application does not crash, it
responds to messages and debugging the application goes just fine,
the window just doesn’t appear.

I’ve tried the following:

  • I tried to force it to be visible by calling the Win32 API function
    ShowWindow(HWND, SW_NORMAL), no effect at all.
  • I added a sleep of 5 seconds before re-initing the application (I
    figured that maybe the driver doesn’t like to create a video window
    directly after having been in fullscreen? Heck I don’t know :-)), no
    effect at all.

Does anyone have any ideas?

Thanks in advance!

Marc


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


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

If SDL destroys then entire SDL context, then that’s no problem. Check
my loop:

init(); << SDL surface is created
intro(); <<
run(); << x— SDL surface is used
outro(); << /
done(); << SDL surface is destroyed

I suppose I may safely assume that SDL is properly programmed and
perfectly able to create more than one surface. So I guess it’s
somewhere in my code, though I can’t find where.

Any more suggestions? :slight_smile:

Marc

TomT64 wrote:> I remember someone mentioning this to me on IRC. The problem seems to

be that SDL destroys
the entire OpenGL Context when the resolution changes, or when switching
from window to
fullscreen. I am unsure of how to solve this, since I don’t work with
OpenGL, but I hope this
helps you.

M.A. Oude Kotte wrote:

Is there nobody who can help me with this?
Marc

M.A. Oude Kotte wrote:

Context:
[SDL 1.2.7]
[Win2k]
[OpenGL window]

Hi, I’m having a problem with the “apply video resolution” option in
my program. I want to be able to change the video resolution (and the
fullscreen/windowed option) “in-game”. I therefor have a very simply,
but effective loop:

do {
    init();
    intro();
    run();
    outro();
    done();
} while (g_perform_restart);

g_perform_restart is set to true when a video resolution change is
needed. When I’m in window mode and I change the “resolution” of the
window, this loop works just fine. When I’m in window mode and change
to some fullscreen resolution, it works just fine. But when I’m in
fullscreen mode and I want to change to some window mode, the problem
occurs.
The video window is created (I see a window button in my taskbar),
but it’s minimized into some sort of very strange state, because I
can’t get it to appear at all. My application does not crash, it
responds to messages and debugging the application goes just fine,
the window just doesn’t appear.

I’ve tried the following:

  • I tried to force it to be visible by calling the Win32 API function
    ShowWindow(HWND, SW_NORMAL), no effect at all.
  • I added a sleep of 5 seconds before re-initing the application (I
    figured that maybe the driver doesn’t like to create a video window
    directly after having been in fullscreen? Heck I don’t know :-)), no
    effect at all.

Does anyone have any ideas?

Thanks in advance!

Marc


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


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


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

Context:
[SDL 1.2.7]
[Win2k]
[OpenGL window]

Hi, I’m having a problem with the “apply video resolution” option in my
program. I want to be able to change the video resolution (and the
fullscreen/windowed option) “in-game”. I therefor have a very simply,
but effective loop:

do {
init();
intro();
run();
outro();
done();
} while (g_perform_restart);

g_perform_restart is set to true when a video resolution change is
needed. When I’m in window mode and I change the “resolution” of the
window, this loop works just fine. When I’m in window mode and change to
some fullscreen resolution, it works just fine. But when I’m in
fullscreen mode and I want to change to some window mode, the problem
occurs.
The video window is created (I see a window button in my taskbar), but
it’s minimized into some sort of very strange state, because I can’t get
it to appear at all. My application does not crash, it responds to
messages and debugging the application goes just fine, the window just
doesn’t appear.

I’ve tried the following:

  • I tried to force it to be visible by calling the Win32 API function
    ShowWindow(HWND, SW_NORMAL), no effect at all.
  • I added a sleep of 5 seconds before re-initing the application (I
    figured that maybe the driver doesn’t like to create a video window
    directly after having been in fullscreen? Heck I don’t know :-)), no
    effect at all.

Does anyone have any ideas?

Can you post a complete minimal example that has this behavior?

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment