summaryrefslogtreecommitdiff
path: root/Examples/OpenGL/TextureManager/readme.txt
blob: 9cbd7f7013b3ce042bdedc23ba9ef79d8cfaf51d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Hello everyone, this is my 2D texture manager class for OpenGL using the FreeImage Library.  

Requirements:
--------------------
OpenGL
STL map class
FreeImage (included)


Usage
--------------------
To load a texture, simply call the LoadTexture function:

TextureManager::Inst()->LoadTexture("img\\bg.jpg", BACKGROUND_IMAGE_ID);

This also binds the loaded texture as the current texture, so after calling it you may make any calls to glTexParameter you may need to specify the properties of the texture.

When you are rendering, just call the TextureManager's BindImage function instead of glBindImage:

TextureManager::Inst()->BindImage(BACKGROUND_IMAGE_ID);

and then do your rendering as normal.
--------------------


Feel free to distribute this as you like, but mind the FreeImage licence included in license-fi.txt, and please don't take credit for my code.  If you modify it, be sure to mention me (Ben English) somewhere.

Please send any comments or suggestions to me at benjamin.english@oit.edu


Thanks to Herve Drolon for the FreeImage library, I've found it to be very useful!