Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/terrain.old/src/lib/graphics/importer/texture_sequence.h

Last change on this file was 8324, checked in by bensch, 18 years ago

trunk: Texture-Sequence is initialized smoothly now in the GLGuiCursor

File size: 2.1 KB
Line 
1/*!
2 * @file texture_sequence.h
3 * @brief Contains the texture_sequence class, that handles the reading of Image-files into multiple Texutres.
4 */
5
6#ifndef _TEXTURE_SEQUENCE_H
7#define _TEXTURE_SEQUENCE_H
8
9#include "texture.h"
10
11#include <vector>
12
13
14//! A Class, that reads in Textures from different fileformats.
15class TextureSequence : public Texture
16{
17  public:
18    TextureSequence(unsigned int count = 0, ...);
19    TextureSequence(const std::vector<std::string>& textureNames, const std::string& prependFolder = "");
20    //  Texture(TEXTURE_TYPE type, int resolution);
21    virtual ~TextureSequence();
22
23    bool loadImageSeries(unsigned int count, ...);
24    bool loadImageSeries(const std::vector<std::string>& textureNames, const std::string& prependFolder = "");
25    bool loadImageSeries(const std::string& imageNameSubstitue, unsigned int from, unsigned int to);
26    bool addFrame(const std::string& image);
27    bool addFrame(SDL_Surface* surface);
28    bool addFrame(GLuint texture);
29
30    void clearLists();
31
32    virtual bool rebuild();
33
34    /** @returns the count of frames in this sequence */
35    inline unsigned int getFrameCount() const { return this->textures.size(); };
36    /** @returns true if no Textures are stored inside of this TextureSequence */
37    inline bool empty() const { return textures.empty(); };
38
39    //void gotoFrame(unsigned int frameNumber);
40    /** @returns The textureID of the Frame @param frameNumber the n-th frame this texture-series.  */
41    inline GLuint getFrameTexture(unsigned int frameNumber) const { return (this->textures.size()>frameNumber)?this->textures[frameNumber]:0; };
42    /** @returns The SDL_Surface of the image at Frame @param frameNumber the n-th frame of this image-seriers */
43    const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return (this->images.size()>frameNumber)?this->images[frameNumber]:NULL; };
44
45  private:
46    std::vector<GLuint>          textures;            //!< The Texture-ID of opengl from this Texture.
47    std::vector<SDL_Surface*>    images;              //!< The SDL_Surfce that stores the Texture on it.
48};
49
50#endif /* _TEXTURE_SEQUENCE_H */
Note: See TracBrowser for help on using the repository browser.