From 1c6a53c07c4a23fb1c0a085895b1cb25a576f143 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Wed, 28 Jul 2010 15:24:12 +0000 Subject: [PATCH] Fixed warnings about ErrorCallback() hidding BGLView method. Should works as expected now. Plus, no more warnings. Yeah. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37791 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/libs/mesa/glut/glutEvent.cpp | 46 ++++++++++++++++---------------- src/libs/mesa/glut/glutWindow.h | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/libs/mesa/glut/glutEvent.cpp b/src/libs/mesa/glut/glutEvent.cpp index 0360ff684f..5c4709e10c 100644 --- a/src/libs/mesa/glut/glutEvent.cpp +++ b/src/libs/mesa/glut/glutEvent.cpp @@ -46,7 +46,7 @@ static GLUTtimer *freeTimerList = 0; * * DESCRIPTION: register a new timer callback ***********************************************************/ -void APIENTRY +void APIENTRY glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value) { GLUTtimer *timer, *other; @@ -119,10 +119,10 @@ processEventsAndTimeouts(void) gBlock.WaitEvent(); // if there is already an event, returns // immediately, otherwise wait forever gBlock.ClearEvents(); - + if(gState.quitAll) exit(0); // exit handler cleans up windows and quits nicely - + if (gState.currentWindow) gState.currentWindow->LockGL(); for(int i=0; itimeout; bigtime_t now = system_time(); - + if (gBlock.PendingEvent()) goto immediatelyHandleEvent; - + if(timeout>now) gBlock.WaitEvent(timeout-now); if (gBlock.PendingEvent()) { @@ -373,12 +373,12 @@ void glutSetKeyRepeat(int repeatMode) case GLUT_KEY_REPEAT_DEFAULT: gState.keyRepeatMode = GLUT_KEY_REPEAT_ON; break; - + case GLUT_KEY_REPEAT_ON: case GLUT_KEY_REPEAT_OFF: gState.keyRepeatMode = repeatMode; break; - + default: __glutWarning("invalid glutSetKeyRepeat mode: %d", repeatMode); } @@ -403,13 +403,13 @@ void GlutWindow::KeyDown(const char *s, int32 slen) { ulong aChar = s[0]; BGLView::KeyDown(s,slen); - + BPoint p; - - if (ignoreKeyRepeat + + if (ignoreKeyRepeat && Window()->CurrentMessage()->FindInt32("be:key_repeat") > 0) return; - + switch (aChar) { case B_FUNCTION_KEY: switch(Window()->CurrentMessage()->FindInt32("key")) { @@ -478,7 +478,7 @@ void GlutWindow::KeyDown(const char *s, int32 slen) goto specialLabel; case B_INSERT: aChar = GLUT_KEY_INSERT; -specialLabel: +specialLabel: if (special) { anyevents = specialEvent = true; GetMouse(&p,&m_buttons); @@ -492,7 +492,7 @@ specialLabel: default: break; } - + if (keyboard) { anyevents = keybEvent = true; GetMouse(&p,&m_buttons); @@ -528,9 +528,9 @@ void GlutWindow::KeyUp(const char *s, int32 slen) { ulong aChar = s[0]; BGLView::KeyUp(s,slen); - + BPoint p; - + switch (aChar) { case B_FUNCTION_KEY: switch(Window()->CurrentMessage()->FindInt32("key")) { @@ -599,7 +599,7 @@ void GlutWindow::KeyUp(const char *s, int32 slen) goto specialLabel; case B_INSERT: aChar = GLUT_KEY_INSERT; -specialLabel: +specialLabel: if (specialUp!=0) { anyevents = specialUpEvent = true; GetMouse(&p,&m_buttons); @@ -613,7 +613,7 @@ specialLabel: default: break; } - + if (keyboardUp!=0) { anyevents = keybUpEvent = true; GetMouse(&p,&m_buttons); @@ -702,7 +702,7 @@ void GlutWindow::MouseCheck() statusX = (int)point.x; statusY = (int)point.y; gBlock.NewEvent(); - } + } BRect bounds = w->Frame(); point.x += bounds.left; point.y += bounds.top; @@ -743,7 +743,7 @@ void GlutWindow::MouseMoved(BPoint point, ulong transit, const BMessage *msg) { BGLView::MouseMoved(point,transit,msg); - + if(transit != B_INSIDE_VIEW) { if (entry) { anyevents = entryEvent = true; @@ -756,7 +756,7 @@ void GlutWindow::MouseMoved(BPoint point, } else entryState = GLUT_LEFT; } - + MouseCheck(); if(m_buttons) { if(motion) { @@ -782,7 +782,7 @@ void GlutWindow::MouseMoved(BPoint point, * * DESCRIPTION: handles mouse wheel events ***********************************************************/ - + void GlutWindow::MessageReceived(BMessage *message) { switch(message->what){ @@ -801,7 +801,7 @@ void GlutWindow::MessageReceived(BMessage *message) } default: break; - } + } } /*********************************************************** @@ -866,7 +866,7 @@ void GlutWindow::Pulse() * * DESCRIPTION: handles GL error messages ***********************************************************/ -void GlutWindow::ErrorCallback(GLenum errorCode) { +void GlutWindow::ErrorCallback(unsigned long errorCode) { __glutWarning("GL error: %s", gluErrorString(errorCode)); } diff --git a/src/libs/mesa/glut/glutWindow.h b/src/libs/mesa/glut/glutWindow.h index 51fb3ee666..5ac3d3a6f3 100644 --- a/src/libs/mesa/glut/glutWindow.h +++ b/src/libs/mesa/glut/glutWindow.h @@ -31,7 +31,7 @@ public: void Draw(BRect updateRect); void Pulse(); // needed since MouseUp() is broken void MouseCheck(); // check for button state changes - void ErrorCallback(GLenum errorCode); + void ErrorCallback(unsigned long errorCode); static long MenuThread(void *menu);