c++ - Get Access violation reading location 0x000000b0 with glutMouseFunc -
I am using glutMouseFunc (mouseFunction); As a callback though I am receiving a violation of 0x000000b0 reading on this line glutMouseFunc (mouseFunction);
I am not using any glutInit function because they interfere with the program and they are not necessarily anyway.
Do anyone know why I am getting this error in this callback?
Here's my initial task:
int initialize () {/ * bunch of code here which is irrelevant to the problem ....... * / glutMouseFunc (Mousefunction); // here is error}
And here is my mouse function:
zero mouse function (int button, int state, int x, int y ) {If (button == GLUT_MIDDLE_BUTTON & amp; amp; amp; amp; state == GLUT_DOWN} {printf ("pressed middle mouse button!"); }}
I have noticed one thing, but when I call the mouse function () in my initial method as a normal function call, then there is no error, but Once I get the mouse function error, with glutMouseFunc (mousefunction), I believe it is more than an error with glutMouseFunc.
Your problem is only on seeing your comments on other questions, that you glutMouseFunc
GLUT says without window The GLUT event callback can be created without proper initialization or without the GLUT window will crash your program.
You also say "GLUT Interface" with your actual window. So why would you try to fully register the GLUT callback if you do not have a window that can actually get events for GLUT dispatch?
Should you use the mouse event handling of the window that you 'got already and then you are using GLUT for? The purpose of the GLUT is to create a window for you and to make event management. If you do not use GLUTTU for that, do not use GLUTTUt at all.
If it is for teapot, well, then you can be without a GLUT.
Comments
Post a Comment