diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-12-08 08:35:21 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-12-08 08:35:21 -0500 |
commit | 49411238b04f3510d18617d1498622cf199c617d (patch) | |
tree | 2cd27693a1a4924d5332f592f666ea49a159544e /include/Texture.h | |
parent | fdd51ab588a2ec9fca54215039803d187a10178e (diff) |
documentation, dialog box borders
Diffstat (limited to 'include/Texture.h')
-rw-r--r-- | include/Texture.h | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/include/Texture.h b/include/Texture.h index 5f5758b..bcd95af 100644 --- a/include/Texture.h +++ b/include/Texture.h @@ -1,28 +1,95 @@ +/** @file Texture.h + * @brief Defines a method for loading textures. + * + * This file gives facilities for easily loading and binding textures. + */ + #ifndef TEXTURE_H #define TEXTURE_H #include <common.h> +/** + * When defined, DEBUG allows extra messages to be printed to the terminal for + * debugging purposes. + */ + #define DEBUG +/** + * Texture functions are given a namespace for better organization. + */ + namespace Texture{ + + /** + * Loads a texture from the given file name, returning the GLuint used for + * later referencing of the texture. + */ + GLuint loadTexture(const char *fileName); } +/** + * The Texturec class. + * + * This class can handle an array of textures and allows easy binding of those + * textures. + */ + class Texturec{ private: + + /** + * Contains the index in the image array of the currently loaded texture. + */ + unsigned int texState; + public: + + /** + * Contains an array of the GLuints returned from Texture::loadTexture(). + */ + GLuint *image; + /** + * Populates the image array from a list of strings, with each string as a + * separate argument. + */ + Texturec(uint amt, ...); + + /** + * Populates the image array from an array of strings. + */ + Texturec(uint amt,const char **paths); + + /** + * Frees memory taken by the image array. + */ + ~Texturec(); + /** + * Binds the next texture in the array, incrementing texState. + */ + void bindNext(); + + /** + * Binds the previous texture in the array, decrementing texState. + */ + void bindPrev(); + + /** + * Binds the texture with the provided index. + */ + void bind(unsigned int); - void walk(); }; #endif //TEXTURE_H |