Jump to content
  • Advertisement
Sign in to follow this  
Nyte_Falcon

HELP

This topic is 4682 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

recently i made a program based on a book i bought on OpenGL now i go and download a NeHe program that i want to impliment into my program however it uses a totally diffrent scheme. for instance mine goes Includes -- varables -- glut callbacks -- void init_opengl -- and then i jump into the main function int main(int argc, char **argv)--

Share this post


Link to post
Share on other sites
Advertisement
where as the file from NeHe lesson 35 has all these like weird sections like

GLuint LoadGLTexture( const char *filename ) --
GLvoid ReSizeGLScene(GLsizei width, GLsizei height) --

how do i integrate these 2?

Share this post


Link to post
Share on other sites
The NeHe tutorials use windows programming to create and handle a window. Judging by what you posted, you are using the GLUT library to handle a window. I'd suggest sticking with GLUT until you understand the basics of OpenGL, then switch to the windows programming stuff.

Share this post


Link to post
Share on other sites
To integrate the LoadGLTexture function into your code, you will simply do a copy/paste of the code and use it whenever you need to load a texture in your program. So for example:

// Global
int TexID1;
// In your initialize function
TexID1 = LoadGLTexture("Youretexture.bmp");


As for the ReSizeGLScene, you will need to use that code in the specified GLUT function. To do that you will simply do something like this:

void ReSizeGLScene(int width, int height)
{
...
}

int main()
{
...
// Here is our new entry in the main function
glutReshapeFunc(ReSizeGLScene);
...
}




So you will need to change the parameter list of the function to match what GLUT needs. Then you just assign that function to the GLUT callback list with the glutReshapeFunc.

Take a look at LightHouse's GLUT tutorials as well for additional stuff you can do. If you run into problems compiling, then you most port the Windows specific code to GLUT specific code, or simply include windows.h

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!