it has been a long time since i use OPENGL last time.
but now i found a problem about my OPENGL,it can't create a gl rendering context,but it works well before.
for i use NEHE'lesson 1 to test ,the error takes place at
if (!(hRC=wglCreateContext(hDC)))
{
KillGLWindow();
MessageBox(NULL,"Can't Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
i couln't find the reason cause this ,is there someone to help me?
thanks
so you're saying that when you run the program you get that MessageBox. it'll be more helpful if you post the code you're using to create the window.
Well i know for one that on my compiler false must be in lowercase unless you have a #define FALSE 0 at the top of your code.
Other than that the problem must be in KillGLWindow() sorry i don;t know much about the NEHE tutorials.
Other than that the problem must be in KillGLWindow() sorry i don;t know much about the NEHE tutorials.
Quote:Original post by Alpha_ProgDes
so you're saying that when you run the program you get that MessageBox. it'll be more helpful if you post the code you're using to create the window.
i am sure that the code is right,the problem is all the code use OPENGL couldn't work on my computer,it tell me that it can't create a gl rendering context.i don't know why and want to know what are the rensons to cause this.
thanks
Quote:Original post by zyzy101Quote:Original post by Alpha_ProgDes
so you're saying that when you run the program you get that MessageBox. it'll be more helpful if you post the code you're using to create the window.
i am sure that the code is right,the problem is all the code use OPENGL couldn't work on my computer,it tell me that it can't create a gl rendering context.i don't know why and want to know what are the rensons to cause this.
thanks
do you happen to have a voodoo2 graphics card ?
Quote:Original post by Anonymous PosterQuote:Original post by zyzy101Quote:Original post by Alpha_ProgDes
so you're saying that when you run the program you get that MessageBox. it'll be more helpful if you post the code you're using to create the window.
i am sure that the code is right,the problem is all the code use OPENGL couldn't work on my computer,it tell me that it can't create a gl rendering context.i don't know why and want to know what are the rensons to cause this.
thanks
do you happen to have a voodoo2 graphics card ?
no i have a nvidia geforce2 mx/mx400 graphics card
i have reinstalled the vc++ 6.0 and graphics card drive,but it still couldn't work,is there something wrong with my system?but it work well before,or any system config file has been changed by other program?
could it be that you have less than 24bit colors? Have you modified the tutorial code or is it the one from nehe?
GF2 should do fine, btw.
GF2 should do fine, btw.
you could try to insert this code to get more information on what went wrong. For more info look up GetLastError and FormatMessage at msdn (thas where I copied the code from ;).
LPVOID lpMsgBuf;FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), 0, // Default language (LPTSTR) &lpMsgBuf, 0, NULL );MessageBox( NULL, (LPCTSTR)lpMsgBuf, L"Error", MB_OK | MB_ICONINFORMATION );LocalFree( lpMsgBuf );
Quote:Original post by nefthy
could it be that you have less than 24bit colors? Have you modified the tutorial code or is it the one from nehe?
GF2 should do fine, btw.
thanks for your reply :) i have found the reason cause this.one or more file in glut.h,glut32.dll anb glut32.lib have been changed by what i didn't know,after recovered,the opengl start to work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement