Changeset 5860 in orxonox.OLD for trunk/src/lib/graphics/importer
- Timestamp:
- Dec 1, 2005, 8:38:37 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/multi_frame_texture.cc
r5858 r5860 34 34 MultiFrameTexture::MultiFrameTexture(unsigned int count, ...) 35 35 { 36 this->setClassID(CL_ TEXTURE, "Texture");36 this->setClassID(CL_MULTI_FRAME_TEXTURE, "MultiFrameTexture"); 37 37 38 va_list textureNameList; 39 va_start(textureNameList, count); 40 41 this->loadImageSeries(count, textureNameList); 38 42 } 39 43 … … 48 52 49 53 50 54 /** 55 * rebuilds all the textures from the Images stored in this FrameSequence 56 */ 51 57 bool MultiFrameTexture::rebuild() 52 58 { … … 64 70 65 71 } 72 73 74 75 bool MultiFrameTexture::loadImageSeries(unsigned int count, ...) 76 { 77 va_list textureNameList; 78 va_start(textureNameList, count); 79 80 this->loadImageSeries(count, textureNameList); 81 } 82 83 bool MultiFrameTexture::loadImageSeries(unsigned int count, va_list textures) 84 { 85 86 87 } 88 89 90 bool MultiFrameTexture::addFrame(const char* imageName) 91 { 92 93 94 } 95 96 97 bool MultiFrameTexture::addFrame(SDL_Surface* surface) 98 { 99 100 101 } 102 103 -
trunk/src/lib/graphics/importer/multi_frame_texture.h
r5859 r5860 10 10 11 11 #include "glincl.h" 12 12 13 #include <vector> 14 #include <stdarg.h> 13 15 14 16 /* Forward Declaration */ … … 16 18 17 19 //! A Class, that reads in Textures from different fileformats. 18 19 20 21 MultiFrameTexture(unsigned int count, ...);20 class MultiFrameTexture : public Texture 21 { 22 public: 23 MultiFrameTexture(unsigned int count = 0, ...); 22 24 // Texture(TEXTURE_TYPE type, int resolution); 23 25 ~MultiFrameTexture(); 24 26 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); 27 31 28 /** @returns The textureID of this texture. */ 29 inline GLuint getFrameTexture(unsigned int frameNumber) const { return this->textures[frameNumber]; }; 32 virtual bool rebuild(); 30 33 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]; }; 32 38 33 34 35 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 }; 37 43 38 44 #endif /* _MULTI_FRAME_TEXTURE_H */ -
trunk/src/lib/graphics/importer/texture.cc
r5859 r5860 116 116 bool Texture::rebuild() 117 117 { 118 if (this->texture != 0 && glIsTexture(this->texture))118 if (this->texture != 0) 119 119 { 120 glDeleteTextures(1,&this->texture); 120 if (glIsTexture(this->texture)) 121 glDeleteTextures(1,&this->texture); 121 122 this->setTexture(0); 122 123 }
Note: See TracChangeset
for help on using the changeset viewer.