Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8322 in orxonox.OLD


Ignore:
Timestamp:
Jun 11, 2006, 11:22:13 PM (18 years ago)
Author:
patrick
Message:

bsp_model: added antialiasing to the orxonox grpahics engine, activated per default

Location:
branches/bsp_model/src/lib/graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/graphics_engine.cc

    r8148 r8322  
    6666
    6767  this->bDisplayFPS = false;
     68  this->bAntialiasing = true;
    6869  this->minFPS = 9999;
    6970  this->maxFPS = 0;
     
    281282  SDL_GL_SetAttribute( SDL_GL_ACCUM_ALPHA_SIZE, 0);
    282283
    283   SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);      //Use at least 5 bits of Red
    284   SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);    //Use at least 5 bits of Green
    285   SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);     //Use at least 5 bits of Blue
    286   SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);   //Use at least 16 bits for the depth buffer
     284  SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);      //Use at least 5 bits of Red
     285  SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);    //Use at least 5 bits of Green
     286  SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);     //Use at least 5 bits of Blue
     287  SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);   //Use at least 16 bits for the depth buffer
    287288  SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);  //Enable double buffering
     289
     290  // enable antialiasing?
     291  if( this->bAntialiasing)
     292  {
     293    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES,4);
     294    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS,1);
     295  }
    288296
    289297  glEnable(GL_CULL_FACE);
  • branches/bsp_model/src/lib/graphics/graphics_engine.h

    r7840 r8322  
    4646    static void setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha = 1.0);
    4747
     48    inline void setAntialiasing(bool flag) { this->bAntialiasing = flag; }
     49    inline bool getAntialiasing() { return this->bAntialiasing; }
    4850
    4951    /** @returns the x resolution */
     
    109111    bool                       shadowsEnabled;     //!< If Shadows should be enabled.
    110112    bool                       particlesEnabled;   //!< If particles should be enabled.
     113    bool                       bAntialiasing;      //!< true if antialiasing enabled
     114
    111115    int                        particlesValue;     //!< How many particles
    112116    int                        textureQuality;     //!< the quality of Textures
Note: See TracChangeset for help on using the changeset viewer.