Skip to main content
GameDev.net gamedev.net
🔒 Locked

HELP!!!!

Started by zyzy101 Apr 22, 2006 at 2:31 AM 8 replies 1k views
Original Post
zyzy101
zyzy101
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
Alpha_ProgDes
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.
Beginner in Game Development?  Read here. And read here.  
Meganan
Meganan
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.
<-> Rate someone badly if they say something that has absolutely nothing to do with your problem; don't rate people badly because they tried to help you with their limited knowledge. <->
zyzy101
zyzy101
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
zyzy101
zyzy101
Quote:
Original post by Anonymous Poster
Quote:
Original post by zyzy101
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


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?
nefthy
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.
nefthy
nefthy
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 );
zyzy101
zyzy101
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.

zyzy101
zyzy101
!!!!!!

it coudn't work again , i tried to do as yesterday did ,but it still couldn't work.should i reinstall the operation system??——_______________——||

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.