I'm learning OpenGl on my own and I'm following: http://www.lighthouse3d.com/tutorials/glut-tutorial/initialization/.
I'm using Visual Studios 2013, and freeglut version 2.8.1, prepackaged: http://www.transmissionzero.co.uk/software/freeglut-devel/
My code is right now simply a copy of the one in the example:
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glVertex3f(-0.5,-0.5,0.0);
glVertex3f(0.5,0.0,0.0);
glVertex3f(0.0,0.5,0.0);
glEnd();
glutSwapBuffers();
}
int main(int argc, char **argv) {
// init GLUT and create Window
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,320);
glutCreateWindow("Lighthouse3D - GLUT Tutorial");
// register callbacks
glutDisplayFunc(renderScene);
// enter GLUT event processing cycle
glutMainLoop();
return 1;
}
My error:
Unhandled exception at 0x1056131C (ig4icd32.dll) in OpenGL.exe: 0xC000041D: An unhandled exception was encountered during a user callback.
Call Stack:
OpenGL.exe!glutCreateWindow_ATEXIT_HACK(const char * title) Line 616 C++
OpenGL.exe!main(int argc, char * * argv) Line 30 C++
freeglut_std.h(this is the line that my break is happening on):
#define glutInit glutInit_ATEXIT_HACK
static int FGAPIENTRY FGUNUSED glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
I've haven't been able to pinpoint what is causing the error. Some more information, I used Visual Studio's project properties tool to do the linking. The include folder in additional includes, the lib folder in the additional includes. I added the freeglut.lib to additional dependencies. And I dropped the freeglut.dll in the folder with the .exe in the debug folder that Visual Studio creates.
I've already tried #define GLUT_DISABLE_ATEXIT_HACK, which did not work. I'm not really sure where to go from here.
Finally some other info since I have a feeling it might also not be helping. I'm running windows 8.1, I have Intel integrated chipset family 4, which does not have 8.1 drivers.
User contributions licensed under CC BY-SA 3.0