fullscreen-window mode switch
Hello all
When I switch between window mode and fullscreen I have to recreate the context so I call
if(display.glContext) aglDestroyContext(display.glContext);
then create a new one like this:
if(targetWindow) fmt = aglChoosePixelFormat(&gDevice, 1, displayModeAttribute);
else fmt = aglChoosePixelFormat(&gDevice, 1, fullScreenModeAttribute);
everything works fine, but it seems that my textures and display lists get discarded from memory.
Is there a way to keep textures and display list in the GPU after aglDestroyContext() calls or is there a way to do the switch without having to recreate the context?
thanks in advance
When I switch between window mode and fullscreen I have to recreate the context so I call
if(display.glContext) aglDestroyContext(display.glContext);
then create a new one like this:
if(targetWindow) fmt = aglChoosePixelFormat(&gDevice, 1, displayModeAttribute);
else fmt = aglChoosePixelFormat(&gDevice, 1, fullScreenModeAttribute);
everything works fine, but it seems that my textures and display lists get discarded from memory.
Is there a way to keep textures and display list in the GPU after aglDestroyContext() calls or is there a way to do the switch without having to recreate the context?
thanks in advance
I think not. My games just reload everything after toggling between modes.
Time is running out!
Yes, you can share the textures/display lists between windowed and fullscreen contexts in 10.3.
So keep the window context around as the main context. Create the fullscreen context shared with the window context.
So keep the window context around as the main context. Create the fullscreen context shared with the window context.
pretty sure it works on older versions too...
http://onesadcookie.is-a-geek.net/book.html shows how.
http://onesadcookie.is-a-geek.net/book.html shows how.
Yeah, I've found it to also work on 10.2, but the technote says 10.3...
Thanks guys.
In which technote?
Do you know how much memory does a context take?, I guess I should not worry about that?
In which technote?
Do you know how much memory does a context take?, I guess I should not worry about that?
This technote.
I think a context takes around 500k. Not enough to worry about until you start leaking them.
I think a context takes around 500k. Not enough to worry about until you start leaking them.
arekkusu Wrote:I think a context takes around 500k. Not enough to worry about until you start leaking them.
Half a meg isn't something to worry about? Man, we grew up in different computing ages. I remember not having half a meg to even work with. Including the OS. Though I'll admit, most modern computers that isn't something to worry about.
iefan Wrote:Half a meg isn't something to worry about? Man, we grew up in different computing ages. I remember not having half a meg to even work with. Including the OS.
That's *nothing*. When I first started working on computers, or "calculation machines" as we called them back then, we didn't have this fancy "RAM". If we wanted the calculation machine to remember something we had to write it to a drum. Not only that, but our bits were different too, because the zero hadn't even been invented yet, so all we had to work with were 1s. This made programming very difficult. But that was OK, because we didn't have any programming languages either. You kids today are spoiled.
Yeah, yeah. WOOD AND ROCKS.
Buy more RAM, stop worrying.
Buy more RAM, stop worrying.
Alright I'll buy some extra memory
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| SDL. How to hide fullscreen window | e40pud | 1 | 3,412 |
Mar 11, 2010 01:23 PM Last Post: cmiller |
|
| Mac OS X. Switching between fullscreen and windowed mode. | e40pud | 2 | 3,481 |
Jan 25, 2010 12:01 PM Last Post: OneSadCookie |
|
| Fullscreen/resolution switch causes texture loss | IBethune | 4 | 3,527 |
Feb 21, 2008 01:37 PM Last Post: OneSadCookie |
|
| Tricks with dialog boxes in fullscreen mode causing permanent framerate drops. | Sea Manky | 2 | 2,638 |
Aug 7, 2007 06:20 AM Last Post: Sea Manky |
|
| Copying from OpenGL window to other window | Ingemar | 7 | 4,061 |
Nov 4, 2006 03:50 AM Last Post: OneSadCookie |
|

