fullscreen-window mode switch

Member
Posts: 157
Joined: 2002.12
Post: #1
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 Rasp
Quote this message in a reply
Member
Posts: 156
Joined: 2002.11
Post: #2
I think not. My games just reload everything after toggling between modes.

Time is running out!
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #3
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
pretty sure it works on older versions too...

http://onesadcookie.is-a-geek.net/book.html shows how.
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #5
Yeah, I've found it to also work on 10.2, but the technote says 10.3...
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #6
Thanks guys.

In which technote?
Do you know how much memory does a context take?, I guess I should not worry about that?
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #7
This technote.
I think a context takes around 500k. Not enough to worry about until you start leaking them.
Quote this message in a reply
Member
Posts: 41
Joined: 2005.02
Post: #8
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.
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2006.10
Post: #9
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.
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #10
Yeah, yeah. WOOD AND ROCKS.

Buy more RAM, stop worrying.
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #11
Alright I'll buy some extra memory Smile
Quote this message in a reply
Post Reply