Sign in to follow this  
coba2

Trouble GLee....

Recommended Posts

I using library GLee for my shadow map project.... And I use C++ code with MFC.. I has been include GLee in my program.. and success. But while my program running. The GLee cannot be work. If i trace the program.. The program message that the version is not compatible, so the function cannot work. I confuse because I has been include the newest version of GLee (2.1). Is somebody know?? Thanx

Share this post


Link to post
Share on other sites
What is not possible? To use a certain extension? If that's the case: it depends on your graphics card which extensions are supported and which are not. Hasn't to do something with GLee

Share this post


Link to post
Share on other sites
But..if depend on my graphic card... I was try to open a project that using the same GLee library in my computer. And it's work and the version is compatible.

But if I using it in my own project. It is not work..because the version is not compatible.

Why????

Share this post


Link to post
Share on other sites
Sorry, but I can't nobody can help you, if you don't describe the problem further, post a few lines of code where the error occurs, post the exact error message or problem description, etc.

Share this post


Link to post
Share on other sites
I'm sorry because i cannot pick the sample code. Because there is no error in my project.. But my project didnot doing right thing like I want.. My shadow map project didn't show the shadow.. it's because the GLee library didn't work.

I think the GLee library didnot match with my VC++ 2005 or VC++ 6.0. Because after I read the explain from Glee.. I know that GLee can operated in VC++ 7 or VC++ 2003. It is my opinion...

Are my opinion is right???

Share this post


Link to post
Share on other sites
No, I use GLee successfully with Visual Studios 2005.

Here's some things to check:

-Are you *sure* that GLee is the problem? Not drawing shadows could be caused by a dozen other things.
-Did you call GLeeInit() after intializing OpenGL but before using extensions?
-Have you checked to make sure that any extensions that you are using are available on your hardware? For example, this checks for the extension ARB_fragment_shader and prints out whether it's available or not.

if(GLEE_ARB_fragment_shader)
printf("ARB_fragment_shader available for use.\n");
else
printf("No ARB_fragment_shader support.\n");

Share this post


Link to post
Share on other sites
Where the GLeeInit() must be place??? Before using extention??? Or where??

I has been do like what you do.. This is my code:

if (!GLEE_ARB_shadow)
{
return false;
}


But,it was always return false.. And i tried to debug it... After I debug.. I know that inside the Glee.cpp, one of the code is doing wrong. The section that doing wrong is in:

const char *__GLeeGetExtStrPlat()
{
#ifdef WIN32
if (!_GLEE_WGL_ARB_extensions_string)
>>>> pwglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB");

if (pwglGetExtensionsStringARB)
return (const char *)pwglGetExtensionsStringARB(wglGetCurrentDC());
#elif defined(__APPLE__) || defined(__APPLE_CC__)
#else
Display *dpy=glXGetCurrentDisplay();
if(dpy)
{
int dpynr=DefaultScreen(dpy);
return (const char*)glXQueryExtensionsString(dpy,dpynr);
}
#endif
return 0;
}

In sign >>>, the result is NULL. So the return always false...

Maybe you can help me why it's happen... Thank..

Share this post


Link to post
Share on other sites
I'm sorry.. I don't understand what you mean about. Can you explain more about your statement.. Thnx

Share this post


Link to post
Share on other sites
Like I said in my first post, you call GLeeInit() after initializing OpenGl, but before using any extensions. For example:

InitOpenGL(); //start up OpenGL

GLeeInit();

if(!GLEE_ARB_shadow)
{
return false;
}

Share this post


Link to post
Share on other sites
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???

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Here, try this:

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

this guy explains it far better than I ever could.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
OK2, thanx for all your help. Now i already can access the GLee in my MFC application. Thanx for all of your help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this