Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Reinitializing OpenGL and SDL

  1. #1
    Intern Contributor
    Join Date
    Sep 2006
    Location
    US(California)
    Posts
    58

    Reinitializing OpenGL and SDL

    I'm not sure if this belongs on a SDL forum or OpenGL forums, but I cant even find a SDL forum so here goes:

    In SDL I there is this deal where if you reset the video mode (change resolution etc) all of OpenGL's state is lost. I can't find the article that states what exactly is lost, but I know it at least includes cached Textures and Display Lists.

    In order to allow the game to change resolutions during run-time/game-play it must reload everything.

    I'm pretty sure my functions for reloading textures and static meshes are working, but I am still doing something wrong.

    Wat would cause this : http://img459.imageshack.us/img459/6520/screen2cd7.jpg

    To look like this: http://img459.imageshack.us/img459/5646/screenhn1.jpg

    It is possible textures are not loading correctly, would that explain every thing in that picture?
    Is the lighting also not working?
    -Josh

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: Reinitializing OpenGL and SDL

    It is possible textures are not loading correctly, would that explain every thing in that picture?
    Looks like it. It would appear that the texture is not being bound, or the texture object is not being properly created/uploaded.

  3. #3
    Intern Contributor
    Join Date
    Sep 2006
    Location
    US(California)
    Posts
    58

    Re: Reinitializing OpenGL and SDL

    Oh! Never mind, I fixed it. In loosing its state it was acting as if GL_TEXTURE_2D disabled.

    I simply re-enabled it (glEnable( GL_TEXTURE_2D )) among other things and it works.

    Sorry to waste any of your time...

    Hopefully this will be useful to someone with the same problem...

    (thanks for your reply Korval)
    -Josh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •