Where have all my textures gone (Curtis Cooper)

Hi,

I’ve done some more work on this issue, and I have now understood it, I
believe. Firstly, I now understand the problem which was pointed out to
me about my disappearing textures in Windows. It makes perfect sense, of
course. If it’s creating a totally new rendering context, and textures
and other objects are attached to rendering contexts, then it stands to
reason that they will disappear from the scene upon redraw if the
rendering context is recreated. So, I know I need to reload the textures
into texture memory right after the SDL_SetVideoMode in Windows.

However, is there another SDL function that works for OpenGL that only
resizes the current rendering context, or places that context into
fullscreen mode, without destroying it?

As for the second issue that I was having with the X server maintaining
the current fullscreen resolution after SDL_Quit(), I’ve resolved that
simply by reverting back to windowed mode just before calling
SDL_Quit(). The code looks roughly like this:

//////////////////////////////////// inside Main Loop ///////////////////

if ( force_quit )
{
#ifndef WIN32

    // Necessary cleanup in Linux of the 
// fullscreen mode if it exists.                    
if ( Fullscreen() )
    {
   // Better hope this works!
       main_screen = SDL_SetVideoMode(1280,1024, bitsPerPixel(),SDL_OPENGL);
                            if ( !main_screen )
                            {
                                cerr << "Reset video mode failed.\n";
                            }
}

#endif
SDL_Quit();

}
/////////////////

Sorry if this solution was obvious from the start.

Thanks,
Curtis


  • Curtis S. Cooper, Graduate Research Assistant         *
    
  •  Lunar and Planetary Laboratory, University of Arizona  *
    
  • Kuiper Space Sciences, Rm. 318                        *
    
  • 1629 E. University Blvd., *
  • Tucson, AZ 85721 * * * * * * * * * * * * * * *
  • Wk: (520) 621-1471 *

I noticed that SDL can use DirectFB or DGA.
How would you get hardware acceleration when you
manipulate the frame buffer directly using either
DirectFB or DGA? Wouldn’t that bypass the 3D
pipelines completely? There is no triangle setup, T&L,
and etc, how could there by hardware acceleration.
Unless you are talking about 2D. But doesn’t frame
buffer mean the graphics memory (which represents the
actual screen) that is mmaped to the memory space of
the application? So you are only manipulating the
pixels of the display buffer. What hardware
acceleration can you do?

thank you,
-ed__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better

I noticed that SDL can use DirectFB or DGA.
How would you get hardware acceleration when you
manipulate the frame buffer directly using either
DirectFB or DGA? Wouldn’t that bypass the 3D
pipelines completely?

Yes, that’s correct.

There is no triangle setup, T&L,
and etc, how could there by hardware acceleration.
Unless you are talking about 2D.

We are indeed talking about 2D acceleration.

But doesn’t frame
buffer mean the graphics memory (which represents the
actual screen) that is mmaped to the memory space of
the application? So you are only manipulating the
pixels of the display buffer.

Yes, that’s correct.

What hardware acceleration can you do?

You can upload surfaces to video memory and do hardware accelerated
rect fills and surface blits.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment