Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5755 in orxonox.OLD for trunk


Ignore:
Timestamp:
Nov 24, 2005, 1:49:15 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: textures are rebuild on resize of the winodow (on winodws)

Location:
trunk/src/lib/graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/graphics_engine.cc

    r5656 r5755  
    3030#include "text.h"
    3131
     32
     33#ifdef __WIN32__
     34 #include "class_list.h"
     35 #include "texture.h"
     36 #include "list.h"
     37#endif
    3238using namespace std;
    3339
     
    203209
    204210  SDL_WM_SetCaption (windowName, icon);
    205 
    206211}
    207212
     
    302307    glLoadIdentity();
    303308    glViewport(0, 0, width, height);                     // Reset The Current Viewport
     309
     310    // REBUILDING TEXTURES (ON WINDOWS CONTEXT SWITCH)
     311#ifdef __WIN32__
     312    tList<BaseObject>* texList = ClassList::getList(CL_TEXTURE);
     313    if (texList != NULL)
     314      {
     315        tIterator<BaseObject>* texIt = texList->getIterator();
     316        Texture* reTex = static_cast<Texture*>(texIt->firstElement());
     317        while (reTex != NULL)
     318          {
     319            reTex->rebuild();
     320           
     321            reTex = static_cast<Texture*>(texIt->nextElement());
     322          }
     323      }
     324#endif /* __WIN32__ */
    304325}
    305326
  • trunk/src/lib/graphics/importer/texture.cc

    r5754 r5755  
    106106}
    107107
    108 bool Texture::reload()
     108bool Texture::rebuild()
    109109{
    110110  if (this->texture != 0)
     
    115115
    116116  if (this->image != NULL)
    117     this->texture = this->loadTexToGL(this->image);
     117    {
     118      PRINTF(4)("Reloading Texture %s\n", this->getName());
     119      this->texture = this->loadTexToGL(this->image);
     120    }
    118121 
    119122}
  • trunk/src/lib/graphics/importer/texture.h

    r5753 r5755  
    2929
    3030  bool loadImage(const char* imageName);
    31   bool reload();
     31  bool rebuild();
    3232
    3333  /** @returns The textureID of this texture.  */
Note: See TracChangeset for help on using the changeset viewer.