Trouble GLee....

Started by
16 comments, last by coba2 16 years, 10 months ago
OK.. I have been add the GLeeInit() before I check the GLEE_ARB_shadow. After I doing that, the result is different. The result is not NULL, but one of the code in GLEE:

version=__GLeeGetVersionNumber((char *)glGetString(GL_VERSION));


In that code... ther result of the version is 257. It's make my program cannot do the choice after that. The code after this is:

*****************************************************************
* Autogenerated linking functions
*****************************************************************/
if (version>=258)
{
_GLEE_VERSION_1_2 = GL_TRUE;
__GLeeLink_GL_VERSION_1_2();
}
if (__GLeeCheckExtension("GL_ARB_imaging", &extensionNames) )
{
_GLEE_ARB_imaging = GL_TRUE;
__GLeeLink_GL_ARB_imaging();
}

All the option is cannot be equal with my version. I confuse why my version is 257. I was tried this program in Console Application mode with same library file, and the result of version is different. In Console Application, the result of version is 512 and can be equal with the option.

Why my version is 257??? Are there something different on MFC and Console Application???
Advertisement
OK friend.. thanx for all your help for me. Now, i already now one way to use the GLee library in MFC VC++8.

After i look the sample code from www.paulsprojects.net, I have opinion that Glee only can use after we initialitation glutCreateWindow(). After i put these code, GLee library can work properly. This is my sample code:

--> glutCreateWindow("Testing");
GLeeInit();
if (!GLEE_ARB_shadow)
return false


But, there another problem. I using MFC with own drawing area from class View. If i create glutCreateWindow(), all of my drawing cannot be displayed in MFC. So, it's cannot work...

Did my opinion is right???

[Edited by - coba2 on May 27, 2007 9:08:04 AM]
gleeinit needs an opengl context to work!
after glutCreateWindow window and context is created so if you use MFC you just need to call gleeInit after context creation and everything should work fine.
So, I just use gleeInit after context creation....

Can you give me a example of code about context creation in MFC?? Because i don't know it. Thanx
To initialize OpenGL, all you need is a window handle. After that, there are certain functions that need to be called in order and if all of them succeed, you have your OpenGL window.

With MFC there are three basic types of applications: dialog based apps, SDI and MDI apps. I'll take a guess that you are trying to create an SDI app. So you let AppWizard do the framework for you and then you add your own initialization functions.

The main drawing window in SDI app is called CChildView by default. That's where your OpenGL initialization belongs. Add a function to CChildView class, call it InitializeOpenGL or whatever, and invoke it from CMainFrame::OnCreate, which is sort of like main initialization function for SDI apps.

Inside this function you can access window handle for CChildView either directly as m_hWnd or via GetSafeHwnd function. From that moment you have everything you need to follow standard OpenGL initialization procedure: ChoosePixelFormat, SetPixelFormat, wglCreateContext, yadda-yadda-yadda... search the google, there are probably thousands of examples. Just extract their initialization code and put it in your InitializeGL function for CChildView class.
Here, try this:

http://www.gamedev.net/reference/articles/article1358.asp

this guy explains it far better than I ever could.
Yes it's right that i using SDI application.

So in function glutCreateWindow in MFC has been replace by InitGL like ChoosePixelFormat, SetPixelFormat, wglCreateContext, etc, isn't???

So, i must take the function GLeeInit() after the all of process InitGL...

OK2. I will try it.

And maybe one of you know sample application that using GLee in MFC, you can tell me. Thanx...
OK2, thanx for all your help. Now i already can access the GLee in my MFC application. Thanx for all of your help.

This topic is closed to new replies.

Advertisement