* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* This program is freely distributable without licensing fees
* and is provided without guarantee or warrantee expressed or
* implied. This program is -not- in the public domain.
*
*
* FILE: glutCursor.cpp
*
* DESCRIPTION: code for handling custom mouse cursors
***********************************************************/
* Headers
***********************************************************/
#include <GL/glut.h>
#include "glutint.h"
#include "glutState.h"
#include "glutCursors.h"
static const unsigned char *cursorTable[] = {
XC_arrow,
XC_top_left_arrow,
XC_hand1,
XC_pirate,
XC_question_arrow,
XC_exchange,
XC_spraycan,
XC_watch,
XC_xterm,
XC_crosshair,
XC_sb_v_double_arrow,
XC_sb_h_double_arrow,
XC_top_side,
XC_bottom_side,
XC_left_side,
XC_right_side,
XC_top_left_corner,
XC_top_right_corner,
XC_bottom_right_corner,
XC_bottom_left_corner,
};
* FUNCTION: glutSetCursor (4.13)
*
* DESCRIPTION: set a new mouse cursor for current window
***********************************************************/
void glutSetCursor(int cursor) {
gState.currentWindow->Window()->Lock();
gState.currentWindow->cursor = cursor;
__glutSetCursor(cursor);
gState.currentWindow->Window()->Unlock();
}
* FUNCTION: __glutSetCursor
*
* DESCRIPTION: the actual cursor changing routine
***********************************************************/
void __glutSetCursor(int cursor) {
int realcursor = cursor;
if (cursor < 0 || cursor > GLUT_CURSOR_BOTTOM_LEFT_CORNER) {
switch(cursor) {
case GLUT_CURSOR_INHERIT:
return;
case GLUT_CURSOR_NONE:
be_app->ObscureCursor();
return;
case GLUT_CURSOR_FULL_CROSSHAIR:
realcursor = GLUT_CURSOR_CROSSHAIR;
break;
default:
__glutWarning("unknown cursor\n");
return;
}
}
be_app->SetCursor(cursorTable[realcursor]);
}
* FUNCTION: glutWarpPointer (x.xx)
*
* DESCRIPTION: move the mouse pointer to a new location
* (note: can't do this in BeOS!)
***********************************************************/
void glutWarpPointer(int x, int y) { }