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
This commit is contained in:
Philippe Houdoin
2010-07-28 15:24:12 +00:00
parent 8b39afead5
commit 1c6a53c07c
2 changed files with 24 additions and 24 deletions
+23 -23
View File
@@ -46,7 +46,7 @@ static GLUTtimer *freeTimerList = 0;
* *
* DESCRIPTION: register a new timer callback * DESCRIPTION: register a new timer callback
***********************************************************/ ***********************************************************/
void APIENTRY void APIENTRY
glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value) glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value)
{ {
GLUTtimer *timer, *other; GLUTtimer *timer, *other;
@@ -119,10 +119,10 @@ processEventsAndTimeouts(void)
gBlock.WaitEvent(); // if there is already an event, returns gBlock.WaitEvent(); // if there is already an event, returns
// immediately, otherwise wait forever // immediately, otherwise wait forever
gBlock.ClearEvents(); gBlock.ClearEvents();
if(gState.quitAll) if(gState.quitAll)
exit(0); // exit handler cleans up windows and quits nicely exit(0); // exit handler cleans up windows and quits nicely
if (gState.currentWindow) if (gState.currentWindow)
gState.currentWindow->LockGL(); gState.currentWindow->LockGL();
for(int i=0; i<gState.windowListSize; i++) { for(int i=0; i<gState.windowListSize; i++) {
@@ -301,10 +301,10 @@ waitForSomething(void)
{ {
bigtime_t timeout = __glutTimerList->timeout; bigtime_t timeout = __glutTimerList->timeout;
bigtime_t now = system_time(); bigtime_t now = system_time();
if (gBlock.PendingEvent()) if (gBlock.PendingEvent())
goto immediatelyHandleEvent; goto immediatelyHandleEvent;
if(timeout>now) if(timeout>now)
gBlock.WaitEvent(timeout-now); gBlock.WaitEvent(timeout-now);
if (gBlock.PendingEvent()) { if (gBlock.PendingEvent()) {
@@ -373,12 +373,12 @@ void glutSetKeyRepeat(int repeatMode)
case GLUT_KEY_REPEAT_DEFAULT: case GLUT_KEY_REPEAT_DEFAULT:
gState.keyRepeatMode = GLUT_KEY_REPEAT_ON; gState.keyRepeatMode = GLUT_KEY_REPEAT_ON;
break; break;
case GLUT_KEY_REPEAT_ON: case GLUT_KEY_REPEAT_ON:
case GLUT_KEY_REPEAT_OFF: case GLUT_KEY_REPEAT_OFF:
gState.keyRepeatMode = repeatMode; gState.keyRepeatMode = repeatMode;
break; break;
default: default:
__glutWarning("invalid glutSetKeyRepeat mode: %d", repeatMode); __glutWarning("invalid glutSetKeyRepeat mode: %d", repeatMode);
} }
@@ -403,13 +403,13 @@ void GlutWindow::KeyDown(const char *s, int32 slen)
{ {
ulong aChar = s[0]; ulong aChar = s[0];
BGLView::KeyDown(s,slen); BGLView::KeyDown(s,slen);
BPoint p; BPoint p;
if (ignoreKeyRepeat if (ignoreKeyRepeat
&& Window()->CurrentMessage()->FindInt32("be:key_repeat") > 0) && Window()->CurrentMessage()->FindInt32("be:key_repeat") > 0)
return; return;
switch (aChar) { switch (aChar) {
case B_FUNCTION_KEY: case B_FUNCTION_KEY:
switch(Window()->CurrentMessage()->FindInt32("key")) { switch(Window()->CurrentMessage()->FindInt32("key")) {
@@ -478,7 +478,7 @@ void GlutWindow::KeyDown(const char *s, int32 slen)
goto specialLabel; goto specialLabel;
case B_INSERT: case B_INSERT:
aChar = GLUT_KEY_INSERT; aChar = GLUT_KEY_INSERT;
specialLabel: specialLabel:
if (special) { if (special) {
anyevents = specialEvent = true; anyevents = specialEvent = true;
GetMouse(&p,&m_buttons); GetMouse(&p,&m_buttons);
@@ -492,7 +492,7 @@ specialLabel:
default: default:
break; break;
} }
if (keyboard) { if (keyboard) {
anyevents = keybEvent = true; anyevents = keybEvent = true;
GetMouse(&p,&m_buttons); GetMouse(&p,&m_buttons);
@@ -528,9 +528,9 @@ void GlutWindow::KeyUp(const char *s, int32 slen)
{ {
ulong aChar = s[0]; ulong aChar = s[0];
BGLView::KeyUp(s,slen); BGLView::KeyUp(s,slen);
BPoint p; BPoint p;
switch (aChar) { switch (aChar) {
case B_FUNCTION_KEY: case B_FUNCTION_KEY:
switch(Window()->CurrentMessage()->FindInt32("key")) { switch(Window()->CurrentMessage()->FindInt32("key")) {
@@ -599,7 +599,7 @@ void GlutWindow::KeyUp(const char *s, int32 slen)
goto specialLabel; goto specialLabel;
case B_INSERT: case B_INSERT:
aChar = GLUT_KEY_INSERT; aChar = GLUT_KEY_INSERT;
specialLabel: specialLabel:
if (specialUp!=0) { if (specialUp!=0) {
anyevents = specialUpEvent = true; anyevents = specialUpEvent = true;
GetMouse(&p,&m_buttons); GetMouse(&p,&m_buttons);
@@ -613,7 +613,7 @@ specialLabel:
default: default:
break; break;
} }
if (keyboardUp!=0) { if (keyboardUp!=0) {
anyevents = keybUpEvent = true; anyevents = keybUpEvent = true;
GetMouse(&p,&m_buttons); GetMouse(&p,&m_buttons);
@@ -702,7 +702,7 @@ void GlutWindow::MouseCheck()
statusX = (int)point.x; statusX = (int)point.x;
statusY = (int)point.y; statusY = (int)point.y;
gBlock.NewEvent(); gBlock.NewEvent();
} }
BRect bounds = w->Frame(); BRect bounds = w->Frame();
point.x += bounds.left; point.x += bounds.left;
point.y += bounds.top; point.y += bounds.top;
@@ -743,7 +743,7 @@ void GlutWindow::MouseMoved(BPoint point,
ulong transit, const BMessage *msg) ulong transit, const BMessage *msg)
{ {
BGLView::MouseMoved(point,transit,msg); BGLView::MouseMoved(point,transit,msg);
if(transit != B_INSIDE_VIEW) { if(transit != B_INSIDE_VIEW) {
if (entry) { if (entry) {
anyevents = entryEvent = true; anyevents = entryEvent = true;
@@ -756,7 +756,7 @@ void GlutWindow::MouseMoved(BPoint point,
} else } else
entryState = GLUT_LEFT; entryState = GLUT_LEFT;
} }
MouseCheck(); MouseCheck();
if(m_buttons) { if(m_buttons) {
if(motion) { if(motion) {
@@ -782,7 +782,7 @@ void GlutWindow::MouseMoved(BPoint point,
* *
* DESCRIPTION: handles mouse wheel events * DESCRIPTION: handles mouse wheel events
***********************************************************/ ***********************************************************/
void GlutWindow::MessageReceived(BMessage *message) void GlutWindow::MessageReceived(BMessage *message)
{ {
switch(message->what){ switch(message->what){
@@ -801,7 +801,7 @@ void GlutWindow::MessageReceived(BMessage *message)
} }
default: default:
break; break;
} }
} }
/*********************************************************** /***********************************************************
@@ -866,7 +866,7 @@ void GlutWindow::Pulse()
* *
* DESCRIPTION: handles GL error messages * DESCRIPTION: handles GL error messages
***********************************************************/ ***********************************************************/
void GlutWindow::ErrorCallback(GLenum errorCode) { void GlutWindow::ErrorCallback(unsigned long errorCode) {
__glutWarning("GL error: %s", gluErrorString(errorCode)); __glutWarning("GL error: %s", gluErrorString(errorCode));
} }
+1 -1
View File
@@ -31,7 +31,7 @@ public:
void Draw(BRect updateRect); void Draw(BRect updateRect);
void Pulse(); // needed since MouseUp() is broken void Pulse(); // needed since MouseUp() is broken
void MouseCheck(); // check for button state changes void MouseCheck(); // check for button state changes
void ErrorCallback(GLenum errorCode); void ErrorCallback(unsigned long errorCode);
static long MenuThread(void *menu); static long MenuThread(void *menu);