Hello,
I have a small example that I am trying to get working with horde. The problem I am having is that I initialize opengl myself and setup all of the extentions that I need. I have not found horde's versions of these. I use gl.h, glu.h and glext.h.
Should I still be using those?
Basicly, it's a 3 step process, Create window, initialize opengl and then render the scene.
Here is one part.. InitializeGL()
Code:
bool InitializeGL()
{
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
// With this we will load the list of extensions the hardware supports.
char *extension = (char*)glGetString(GL_EXTENSIONS);
// Check for multitexture support.
if(strstr(extension, "GL_ARB_multitexture") == 0) return false;
// Load the multitexture funtion and test if all went well.
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTextureARB");
glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)wglGetProcAddress("glMultiTexCoord2fARB");
// Error checking to make sure functions loaded.
if(!glActiveTextureARB || !glMultiTexCoord2fARB) return false;
..then my level loading code..
}
And now the code to render the scene..
Code:
void RenderScene()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clears the screen.
glLoadIdentity(); //Reset modelview matrix for new frame.
// Set the camera.
gluLookAt(Camera.mPos.x, Camera.mPos.y, Camera.mPos.z,
Camera.mView.x, Camera.mView.y, Camera.mView.z,
Camera.mUp.x, Camera.mUp.y, Camera.mUp.z);
// Grab the model view matrix and the projection matrix and store them in our arrays.
float model[16] = {0};
float proj[16] = {0};
glGetFloatv(GL_PROJECTION_MATRIX, proj);
glGetFloatv(GL_MODELVIEW_MATRIX, model);
....rendering level code..
}
If someone can tell me how I need to do both of those parts with horde. or show me an example, that should be good enough. Looking in the examples isn't of much help as there is no such code like that in there. I've done all of this in c before but I'm still not great with c++.
Any ideas?
Thanks,
Chris