Mac OS X. Switching between fullscreen and windowed mode.

Posts: 9
Joined: 2010.01
Post: #1
I have a project in the works with OpenGL and SDL.
User can resize the window either fullscreen/windowed mode using option.

I use SDL_SetVideoMode to set up the window, but this solution destory the original SDL_Surface context (so all my OpenGL textures get cleaned too).

How can I correctly switches between fullscreen and windowed mode without textures cleaning?
Quote this message in a reply
Posts: 1,487
Joined: 2002.09
Post: #2
You can't with SDL. Same problem as having a resizable window, SDL makes a new OpenGL context every time anything changes.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #3
You can write to Cocoa directly and use -[NSView enterFullScreenMode:withOptions:] and -[NSView exitFullScreenModeWithOptions] to toggle at will, but SDL doesn't support this.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  switching screen resolution NelsonMandella 3 5,219 Apr 25, 2010 01:33 PM
Last Post: SethWillits
  Full Screen Switching Blacktiger 3 5,205 Feb 9, 2008 03:05 PM
Last Post: Blacktiger
  Problems trying to fade in windowed mode Wowbagger 4 6,047 Aug 13, 2007 12:11 PM
Last Post: Wowbagger
  Tricks with dialog boxes in fullscreen mode causing permanent framerate drops. Sea Manky 2 4,480 Aug 7, 2007 06:20 AM
Last Post: Sea Manky
  opengl bitmap font question: switching to fullscreen moon_magic 2 4,382 Jul 8, 2006 03:39 PM
Last Post: OneSadCookie