Ok basically I'm making an OpenGL game and having a bit of trouble loading textures.
I have followed a few tutorials and created a game engine with a resource manager. This resource manager can simply create, buffer and draw textures by using a call like this:
Code:
[[g_ResManager getTexture:@"testImage.png"] drawAtPoint:CGPointMake(10, 10)];
My problem is that I really want to use this setup (manager) to load textures that I can bind and use in a more typical OpenGL way.
e.g.
Code:
glBindTexture(GL_TEXTURE_2D, cubeTexture[0]);
I have this so far:
Code:
Cube.h
GLTexture *testTexture[1];
GLuint cubeTexture[1];
Code:
Cube.m
testTexture[0] = [g_ResManager getTexture:@"testImage.png"];
//How do I get the texture from here (above) to this (below)?
glBindTexture(GL_TEXTURE_2D, cubeTexture[0]);
So I would very much appreciate it if anyone could give me advice / an example of how to do this.
I have written a standard texture loader before, but would really like to use the resource manager I have.
Thanks