Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef IMAGEWRAPPER_JAMES
- #define IMAGEWRAPPER_JAMES
- #include "graphics.h"
- /*
- Private header
- 1)The goal of this class is a class that loads/unloads image for opengl
- 2)Keeps track of how images by
- -filename
- -openGLtextureID
- -image/2D image Metrics in terms of raw pixel data
- 3)Loads sentinal image if the image failed to load
- 4) Contains implementation to keep track of how many applications of this image are being used
- 4) Note: Does NOT sanity check if a given image file has been all ready loaded
- */
- template <class T> class ImageWrapper {
- public:
- ImageWrapper(cch* fileName_);
- ~ImageWrapper(void);
- //Modifiers
- void bindTexture(void);
- const ui& incrementInstances(void);
- const ui& decrementInstances(void);
- //Non Const access
- sf::Image& image(void);
- //const access
- cch* fileName(void) const;
- const ui& instances(void) const;
- const sf::Image& image(void) const;
- const GLuint& textureID(void) const;
- //static access
- static cch* failureSignature(void);
- //Const calculations
- const vt size(void) const;
- const T area(void) const;
- const vt inertia(void) const;
- private:
- //Constructor and Destructor Helpers
- void loadImage(void);
- void loadTexture(void);
- void removeTexture(void);
- //Members
- ui _instances;
- cch* _fileName;
- sf::Image _image;
- GLuint _textureID;
- static cch* _failureSignature;
- };
- template <class T> cch* ImageWrapper<T>::_failureSignature ="images/LoadImageFailure2.jpg";
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement