Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5860 in orxonox.OLD for trunk/src/lib/graphics/importer


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

orxonox/trunk: some initial work at MultiFrameTexture.cc

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

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/multi_frame_texture.cc

    r5858 r5860  
    3434MultiFrameTexture::MultiFrameTexture(unsigned int count, ...)
    3535{
    36   this->setClassID(CL_TEXTURE, "Texture");
     36  this->setClassID(CL_MULTI_FRAME_TEXTURE, "MultiFrameTexture");
    3737
     38  va_list textureNameList;
     39  va_start(textureNameList, count);
     40
     41  this->loadImageSeries(count, textureNameList);
    3842}
    3943
     
    4852
    4953
    50 
     54/**
     55 * rebuilds all the textures from the Images stored in this FrameSequence
     56 */
    5157bool MultiFrameTexture::rebuild()
    5258{
     
    6470
    6571}
     72
     73
     74
     75bool MultiFrameTexture::loadImageSeries(unsigned int count, ...)
     76{
     77  va_list textureNameList;
     78  va_start(textureNameList, count);
     79
     80  this->loadImageSeries(count, textureNameList);
     81}
     82
     83bool MultiFrameTexture::loadImageSeries(unsigned int count, va_list textures)
     84{
     85
     86
     87}
     88
     89
     90bool MultiFrameTexture::addFrame(const char* imageName)
     91{
     92
     93
     94}
     95
     96
     97bool MultiFrameTexture::addFrame(SDL_Surface* surface)
     98{
     99
     100
     101}
     102
     103
  • trunk/src/lib/graphics/importer/multi_frame_texture.h

    r5859 r5860  
    1010
    1111#include "glincl.h"
     12
    1213#include <vector>
     14#include <stdarg.h>
    1315
    1416/* Forward Declaration */
     
    1618
    1719//! A Class, that reads in Textures from different fileformats.
    18   class MultiFrameTexture : public Texture
    19   {
    20     public:
    21       MultiFrameTexture(unsigned int count, ...);
     20class MultiFrameTexture : public Texture
     21{
     22  public:
     23    MultiFrameTexture(unsigned int count = 0, ...);
    2224  //  Texture(TEXTURE_TYPE type, int resolution);
    23       ~MultiFrameTexture();
     25    ~MultiFrameTexture();
    2426
    25       bool loadImages(unsigned int cound, ...);
    26       bool rebuild();
     27    bool loadImageSeries(unsigned int count, ...);
     28    bool loadImageSeries(unsigned int count, va_list textureNames);
     29    bool addFrame(const char* image);
     30    bool addFrame(SDL_Surface* surface);
    2731
    28       /** @returns The textureID of this texture.  */
    29       inline GLuint getFrameTexture(unsigned int frameNumber) const { return this->textures[frameNumber]; };
     32    virtual bool rebuild();
    3033
    31       const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return this->images[frameNumber]; };
     34    /** @returns The textureID of the Frame @param frameNumber the n-th frame this texture-series.  */
     35    inline GLuint getFrameTexture(unsigned int frameNumber) const { return this->textures[frameNumber]; };
     36    /** @returns The SDL_Surface of the image at Frame @param frameNumber the n-th frame of this image-seriers */
     37    const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return this->images[frameNumber]; };
    3238
    33     private:
    34       std::vector<GLuint>          textures;            //!< The Texture-ID of opengl from this Texture.
    35       std::vector<SDL_Surface*>    images;              //!< The SDL_Surfce that stores the Texture on it.
    36   };
     39  private:
     40    std::vector<GLuint>          textures;            //!< The Texture-ID of opengl from this Texture.
     41    std::vector<SDL_Surface*>    images;              //!< The SDL_Surfce that stores the Texture on it.
     42};
    3743
    3844#endif /* _MULTI_FRAME_TEXTURE_H */
  • trunk/src/lib/graphics/importer/texture.cc

    r5859 r5860  
    116116bool Texture::rebuild()
    117117{
    118   if (this->texture != 0 && glIsTexture(this->texture))
     118  if (this->texture != 0)
    119119    {
    120       glDeleteTextures(1,&this->texture);
     120      if (glIsTexture(this->texture))
     121        glDeleteTextures(1,&this->texture);
    121122      this->setTexture(0);
    122123    }
Note: See TracChangeset for help on using the changeset viewer.