-
Notifications
You must be signed in to change notification settings - Fork 0
Texture
Jesusemora edited this page Mar 10, 2023
·
2 revisions
Loads a texture in memory. it also has functions for binding textures to opengl and swaping textures. work in progress
int width |
width of the image |
int height |
height of the image |
unsigned char* imageO |
stores loaded image |
bool isAlpha |
used to selected between GL_RGB and GL_RGBA
|
void createTex(char* filePath) |
loads a texture from file as RGB | |||||||||||||||||||||||||||||||||||||||
void createTex(char* filePath, bool alpha) |
when alpha is used, loads a texture from file as RGBA | |||||||||||||||||||||||||||||||||||||||
void SetFlags(int ws, int wt, int filtmin, int filtmax, bool mipmap = true) |
sets the horizontal and vertical wrapping ws and wt, filtering min and max filtmin and filtmax and wheter or not to generate mipmaps.
|
|||||||||||||||||||||||||||||||||||||||
void BindTexture(int id, GLuint *textureID) |
binds the current texture to the location id using a GLuint textureID previously generated with glGenTextures(size, textureID)
|
|||||||||||||||||||||||||||||||||||||||
void SwapTexture(int id, GLuint *textureID) |
used during render loop. assigns the current texture to the location id (GL_TEXTURE0 + id) |