OpenGL Textures Disappear after SDL_VIDEORESIZE

This is a discussion on OpenGL Textures Disappear after SDL_VIDEORESIZE within the Game Programming forums, part of the General Programming Boards category; If I use SDL_RESIZABLE together with OpenGL, after resizing the window, all my textures would disappear. Is that normal? And ...

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    66

    OpenGL Textures Disappear after SDL_VIDEORESIZE

    If I use SDL_RESIZABLE together with OpenGL, after resizing the window, all my textures would disappear.
    Is that normal? And if so, should I reload it again after resizing?

  2. #2
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    If the OpenGL context is lost, the textures and such will be lost. I don't know much about the SDL, but I suppose it's possible that it's dropping context when resizing for some reason. Which still seems like odd behavior to me, so it could be something else entirely too .
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  3. #3
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    I seem to recall soething about having to acquire a new instance after resizing, but I could be wrong. I havent worked too much with OpenGL in years.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,047
    You have to call SDL_SetVideoMode() when you receive an SDL_VIDEORESIZE event. This is as true when you're not using OpenGL as when you are.

    Just make sure you pass the new window size to SDL_SetVideoMode(), unless you want different behaviour for some reason.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multiple textures in OpenGL...
    By yaya in forum Game Programming
    Replies: 1
    Last Post: 02-12-2008, 07:24 AM
  2. OpenGL Textures and TGAs
    By ay_okay in forum Game Programming
    Replies: 3
    Last Post: 06-13-2005, 09:06 PM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. OpenGL, loading BMP Textures?
    By Zeusbwr in forum Game Programming
    Replies: 12
    Last Post: 12-09-2004, 04:16 PM
  5. OpenGL / Moveing textures?
    By Oluf in forum Game Programming
    Replies: 7
    Last Post: 06-08-2004, 01:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21