[3341] | 1 | /*! |
---|
[5768] | 2 | * @file texture.h |
---|
| 3 | * @brief Contains the texture class, that handles the reading of Images into Texutre-files. |
---|
| 4 | */ |
---|
[3341] | 5 | |
---|
[5861] | 6 | #ifndef _TEXTURE_SEQUENCE_H |
---|
| 7 | #define _TEXTURE_SEQUENCE_H |
---|
[3341] | 8 | |
---|
[5858] | 9 | #include "texture.h" |
---|
[3548] | 10 | |
---|
[5768] | 11 | #include "glincl.h" |
---|
[5860] | 12 | |
---|
[5858] | 13 | #include <vector> |
---|
[5860] | 14 | #include <stdarg.h> |
---|
[3548] | 15 | |
---|
[5768] | 16 | /* Forward Declaration */ |
---|
[5239] | 17 | struct SDL_Surface; |
---|
| 18 | |
---|
[3341] | 19 | //! A Class, that reads in Textures from different fileformats. |
---|
[5861] | 20 | class TextureSequence : public Texture |
---|
[5860] | 21 | { |
---|
| 22 | public: |
---|
[5861] | 23 | TextureSequence(unsigned int count = 0, ...); |
---|
[4466] | 24 | // Texture(TEXTURE_TYPE type, int resolution); |
---|
[5861] | 25 | ~TextureSequence(); |
---|
[3905] | 26 | |
---|
[5860] | 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); |
---|
[5753] | 31 | |
---|
[5860] | 32 | virtual bool rebuild(); |
---|
[3341] | 33 | |
---|
[5865] | 34 | /** @returns the count of frames in this sequence */ |
---|
| 35 | inline unsigned int getFrameCount() const { return this->textures.size(); }; |
---|
| 36 | |
---|
| 37 | void gotoFrame(unsigned int frameNumber); |
---|
[5860] | 38 | /** @returns The textureID of the Frame @param frameNumber the n-th frame this texture-series. */ |
---|
[5865] | 39 | inline GLuint getFrameTexture(unsigned int frameNumber) const { return (this->textures.size()>frameNumber)?this->textures[frameNumber]:0; }; |
---|
[5860] | 40 | /** @returns The SDL_Surface of the image at Frame @param frameNumber the n-th frame of this image-seriers */ |
---|
[5865] | 41 | const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return (this->images.size()>frameNumber)?this->images[frameNumber]:NULL; }; |
---|
[5856] | 42 | |
---|
[5860] | 43 | private: |
---|
| 44 | std::vector<GLuint> textures; //!< The Texture-ID of opengl from this Texture. |
---|
| 45 | std::vector<SDL_Surface*> images; //!< The SDL_Surfce that stores the Texture on it. |
---|
| 46 | }; |
---|
[5768] | 47 | |
---|
[5861] | 48 | #endif /* _TEXTURE_SEQUENCE_H */ |
---|