Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5857 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Dec 1, 2005, 7:38:14 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: enableTexture now a property of Texture and not GraphicsEngine → Texture is a Leaf now

@patrick: as you said so long ago, this is the better idea

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

Legend:

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

    r5819 r5857  
    3131
    3232#include "globals.h"
     33#include "texture.h"
    3334
    3435#ifdef __WIN32__
    3536 #include "class_list.h"
    36  #include "texture.h"
    3737 #include "list.h"
    3838 #include "model.h"
     
    131131  const char* textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");
    132132  if (strchr(textures, '1') || !strcasecmp(textures, "true"))
    133     this->texturesEnabled = true;
     133    Texture::setTextureEnableState( true);
    134134  else
    135     this->texturesEnabled = false;
     135    Texture::setTextureEnableState(false);
    136136
    137137  // searching for a usefull resolution
     
    365365
    366366/**
    367  * if Textures should be enabled
    368 */
    369 bool GraphicsEngine::texturesEnabled = true;
    370 
    371 /**
    372367 *
    373368 * @param show if The mouse-cursor should be visible
  • trunk/src/lib/graphics/graphics_engine.h

    r5366 r5857  
    8383
    8484  public:
    85     static bool             texturesEnabled;    //!< if textures should be enabled (globally)
    86 
    8785
    8886  private:
  • trunk/src/lib/graphics/importer/texture.h

    r5856 r5857  
    3838      const SDL_Surface* const getStoredImage() { return this->image; };
    3939
     40      static void setTextureEnableState(bool texturesEnabled);
     41      /** @returns true if Textures are enabled */
     42      inline static bool getTextureEnableState() { return Texture::texturesEnabled; };
     43
    4044    protected:
    4145      bool prepareSurface(SDL_Surface* input);
     
    4549
    4650    private:
    47       GLuint        texture;            //!< The Texture-ID of opengl from this Texture.
    48       bool          bAlpha;             //!< if the texture has an alpha channel.
    49       SDL_Surface*  image;              //!< The SDL_Surfce that stores the Texture on it.
     51      GLuint           texture;            //!< The Texture-ID of opengl from this Texture.
     52      bool             bAlpha;             //!< if the texture has an alpha channel.
     53      SDL_Surface*     image;              //!< The SDL_Surfce that stores the Texture on it.
     54
     55      static bool      texturesEnabled;    //!< If the Textures are enabled.
    5056  };
    5157
Note: See TracChangeset for help on using the changeset viewer.