We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 378 - error while switching OGL->2D framebuffer
Summary: error while switching OGL->2D framebuffer
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.11
Hardware: x86 Windows (XP)
: P1 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-1.2.14
Depends on:
Blocks:
 
Reported: 2006-12-30 16:51 UTC by Tomek Kazmierczak
Modified: 2009-09-20 22:41 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomek Kazmierczak 2006-12-30 16:51:02 UTC
I've recently noticed a bug in some part of SDL_video. This bug seems to be related only
to the windows version of the SDL, but I'm not sure - I've tested my SDL app only under
linux and under windows and it apeared olny under windows.

My app (it's a game) renders a 'menu' in the 2D mode (2D SDL framebuffer) and the game play
uses 3D mode (OpenGL). When one starts the game-paly the app swithces to the OpenGL mode
(with SDL_SetVideoMode of course;). When the player quits the game-play the app switches
back to the 2D framebuffer.
Under linux everything is OK, but under windows _sometimes_ when switching from OGL to 2D fb
the screen is not beeing updated with menu's image but one can see the last image generated
by the OpenGL. The menu is running (I'm sure about that!) but the SDL does not display
it's image.

This happens _only_ When the video mede is changed from 3D to 2D framebuffer _with out_
changing the screen resolution (when screen width, height and bpp are not changed), eg.

//swithch to OpenGL when entering the game
SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE | SDL_FULLSCREEN | SDL_OPENGL);

//play the game
...

//switch back to 2D fb when entering the menu
SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF);

//oops! I can hear the in-menu music but I can see only the last image rendered by OGL!

When changing either only the screen size or only the bit depth everything works fine (eg.
when in 3D mode the resolution is 800x600x24 and in the menu it is 640x480x24).

I think it has sth. to do with the OpenGL's rendering context, or something like that -
when I was trying to find the source of such behaviour I've noticed that it never happens
if I comment out all calls to SDL_GL_SwapBuffers. Of course I can't see anything but a
black screen during the game-play then, but when going back to the menu everything is OK
(menu appears normally).
Comment 1 Sam Lantinga 2007-07-07 21:22:37 UTC
Any chance you can attach a test case?  Maybe you can modify the testgl test program to exhibit the problem?
Comment 2 Ryan C. Gordon 2007-07-08 23:50:44 UTC
Bumping some bugs' priorities to P1 for consideration before the 1.2.12 release (though some may not be resolved for 1.2.12).

--ryan.

Comment 3 Sam Lantinga 2007-07-19 01:18:42 UTC
Any update on this?
Comment 4 Ryan C. Gordon 2009-09-13 16:33:29 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 5 Sam Lantinga 2009-09-20 22:41:51 UTC
This hasn't been updated in a couple years.  Please reopen this if it's still active in 1.3.