Horde3D

Next-Generation Graphics Engine
It is currently 02.05.2025, 14:09

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 12.04.2008, 06:04 
Offline

Joined: 10.04.2008, 11:17
Posts: 6
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


Top
 Profile  
Reply with quote  
PostPosted: 12.04.2008, 15:22 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
Horde is a rendering engine, not a windowing framework. The idea is that you never have to touch low-level window initialisation code or OpenGL rendering code, because that is all abstracted away from you.

Everything you are trying to do is already done for you internally by Horde (or GLFW for the window initialisation code). Take another look at the examples and the documentation - they show you how to get a window, control the camera, and load up models to be rendered.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 13.04.2008, 10:03 
Offline

Joined: 10.04.2008, 11:17
Posts: 6
Hello,

Thanks for the reply.. The code above was what I finally got working to load quake 3 files, bsp + pvs. That was where I was getting confused since I only needed the bsp/pvs code and not the opengl code as you had mentioned.

I'm getting the hang of it now. I like the xml file usage and after noticing the terrain sample, I am going to try and see about reworking the terrain loader to load the default exported xml files from IrrEdit (Free). http://www.ambiera.com/irredit/

Thanks again,
Chris


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group