Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10460 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Jan 28, 2007, 9:26:08 PM (18 years ago)
Author:
patrick
Message:

some texture attributes, camera target fix

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

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/texture.h

    r9882 r10460  
    5555  static GLuint loadTexToGL (const SDL_Surface* surface, GLenum target = GL_TEXTURE_2D);
    5656
     57  float getHeight() { return this->data->getHeight(); }
     58  float getWidth() { return this->data->getWidth(); }
     59
    5760protected:
    5861  bool setSurface(SDL_Surface* newSurface) { return this->data->setSurface(newSurface); };
  • trunk/src/lib/graphics/importer/texture_data.cc

    r8363 r10460  
    2121#include "compiler.h"
    2222
    23 #include "sdlincl.h"
    2423
    2524/**
     
    3130  this->texture = 0;
    3231  this->image = NULL;
     32  this->height = 0.;
     33  this->width = 0.;
    3334}
    3435
     
    5657bool TextureData::loadSurface(SDL_Surface* surface, GLenum target)
    5758{
     59  if( surface != NULL)
     60  {
     61    this->height = surface->h;
     62    this->width = surface->w;
     63  }
     64
    5865  if (Texture::getTextureEnableState())
    5966  {
  • trunk/src/lib/graphics/importer/texture_data.h

    r9869 r10460  
    1111#include "glincl.h"
    1212#include "count_pointer.h"
     13#include "sdlincl.h"
     14
    1315
    1416/* Forward Declaration */
     
    3840    bool setAlpha(bool hasAlpha) { this->bAlpha = hasAlpha; return this->bAlpha; };
    3941    bool setTexture(GLuint texture);
     42    float getHeight() { return this->height;}
     43    float getWidth() { return this->width; }
    4044
    4145  private:
     46    float            height;             //!< height of tex
     47    float            width;              //!< width of tex
    4248    GLuint           texture;            //!< The Texture-ID of opengl from this Texture.
    4349    bool             bAlpha;             //!< if the texture has an alpha channel.
Note: See TracChangeset for help on using the changeset viewer.