const GLubyte *szExtensions = glGetString(GL_EXTENSIONS);
char m[1000];
sprintf(m, "%s", (char *)szExtensions);
MessageBox(NULL, m, "Error", MB_OK | MB_TOPMOST);
PLEASE HELP
char* Buffer = (char*)malloc(strlen((char*)glGetString(GL_EXTENSIONS))+1);strcpy(Buffer, (char*)glGetString(GL_EXTENSIONS));MessageBox(NULL, Buffer, "Error", MB_OK);free(Buffer);
Looks like an error occured. E.g. if you call glGetString between glBegin()/glEnd(), it will return 0. Use glGetError() to retrieve the error code.
Quote:Original post by UltimaX
*** Source Snippet Removed ***
Unhandled exception at 0x0041bad0 in Ancient Spirit Engine.exe: 0xC0000005: Access violation reading location 0x00000000.
this is the error i get...
Quote:Original post by Konfusius
Looks like an error occured. E.g. if you call glGetString between glBegin()/glEnd(), it will return 0. Use glGetError() to retrieve the error code.
actually im not drawing at all... i havent even initialized the HGLRC or HDC... no PIXELFORMAT and etc...
Error: invalid handle...
*FEELS STUPID*
...............................................
ow.... now i get it... DUH....
Thanks you all :)
...............................................
ow.... now i get it... DUH....
Thanks you all :)
const GLubyte *szExtensions = glGetString(GL_EXTENSIONS);char m[1000];sprintf(m, "%s", (char *)szExtensions);MessageBox(NULL, m, "Error", MB_OK | MB_TOPMOST);
I'd like to add that 1000 characters is probably not enough to fit every extension, except on older graphics cards. If you're using C, you should use strlen, malloc and strncpy to make m the proper size, if you use C++ use std::string...
Tom
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement