Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6129 in orxonox.OLD


Ignore:
Timestamp:
Dec 16, 2005, 2:01:16 PM (18 years ago)
Author:
patrick
Message:

network: read some stuff about textures, extending the texture class. not yet finished

Location:
branches/network/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/importer/texture.cc

    r5863 r6129  
    3737  this->texture = 0;
    3838  this->image = NULL;
     39  this->priority = 0.5;
    3940
    4041  if (imageName != NULL)
     
    251252  glGenTextures(1, &texture);
    252253  glBindTexture(GL_TEXTURE_2D, texture);
    253   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    254   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     254
     255  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, /*GL_LINEAR*/ GL_LINEAR_MIPMAP_LINEAR);
     256  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, /*GL_LINEAR*/ GL_LINEAR);
     257  /* control the mipmap levels */
     258  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, -100);
     259  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
     260  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_PRIORITY, this->priority);
     261
    255262  // build the Texture
    256263  glTexImage2D(GL_TEXTURE_2D,
     
    262269               GL_UNSIGNED_BYTE,
    263270               surface->pixels);
    264   // build the MipMaps
     271
     272  // build the MipMaps automaticaly
    265273  gluBuild2DMipmaps(GL_TEXTURE_2D,
    266274                    GL_RGBA,
     
    273281  return texture;
    274282}
     283
  • branches/network/src/lib/graphics/importer/texture.h

    r5859 r6129  
    3939
    4040      // Utility functionality:
    41       static SDL_Surface* prepareSurface(SDL_Surface* input, bool& hasAlpha);
    42       static GLuint loadTexToGL (const SDL_Surface* surface);
     41      SDL_Surface* prepareSurface(SDL_Surface* input, bool& hasAlpha);
     42      GLuint loadTexToGL (const SDL_Surface* surface);
    4343
    4444    protected:
     
    5353      bool             bAlpha;             //!< if the texture has an alpha channel.
    5454      SDL_Surface*     image;              //!< The SDL_Surfce that stores the Texture on it.
     55      GLclampf         priority;           //!< the priority of the current texture (used for garphics cards with limited mem)
    5556
    5657      static bool      texturesEnabled;    //!< If the Textures are enabled.
  • branches/network/src/lib/sound/sound_engine.cc

    r6117 r6129  
    291291
    292292
    293   ALchar deviceName[] =
     293  ALubyte deviceName[] =
    294294
    295295#ifdef __WIN32__
Note: See TracChangeset for help on using the changeset viewer.