summaryrefslogtreecommitdiff
path: root/src/glut/beos/glutCallback.cpp
blob: 82707d5db25c3bf184766a4a7adaa855b1548d38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/***********************************************************
 *	Copyright (C) 1997, Be Inc.  All rights reserved.
 *
 *  FILE:	glutCallback.cpp
 *
 *	DESCRIPTION:	put all the callback setting routines in
 *		one place
 ***********************************************************/

/***********************************************************
 *	Headers
 ***********************************************************/
#include <GL/glut.h>
#include "glutint.h"
#include "glutState.h"

/***********************************************************
 *	Window related callbacks
 ***********************************************************/
void APIENTRY 
glutDisplayFunc(GLUTdisplayCB displayFunc)
{
  /* XXX Remove the warning after GLUT 3.0. */
  if (!displayFunc)
    __glutFatalError("NULL display callback not allowed in GLUT 3.0; update your code.");
  gState.currentWindow->display = displayFunc;
}

void APIENTRY 
glutKeyboardFunc(GLUTkeyboardCB keyboardFunc)
{
  gState.currentWindow->keyboard = keyboardFunc;
}

void APIENTRY 
glutSpecialFunc(GLUTspecialCB specialFunc)
{
  gState.currentWindow->special = specialFunc;
}

void APIENTRY 
glutMouseFunc(GLUTmouseCB mouseFunc)
{
  gState.currentWindow->mouse = mouseFunc;
}

void APIENTRY 
glutMotionFunc(GLUTmotionCB motionFunc)
{
  gState.currentWindow->motion = motionFunc;
}

void APIENTRY 
glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc)
{
  gState.currentWindow->passive = passiveMotionFunc;
}

void APIENTRY 
glutEntryFunc(GLUTentryCB entryFunc)
{
  gState.currentWindow->entry = entryFunc;
  if (!entryFunc) {
    gState.currentWindow->entryState = -1;
  }
}

void APIENTRY 
glutVisibilityFunc(GLUTvisibilityCB visibilityFunc)
{
  gState.currentWindow->visibility = visibilityFunc;
}

void APIENTRY 
glutReshapeFunc(GLUTreshapeCB reshapeFunc)
{
  if (reshapeFunc) {
    gState.currentWindow->reshape = reshapeFunc;
  } else {
    gState.currentWindow->reshape = __glutDefaultReshape;
  }
}

/***********************************************************
 *	General callbacks (timer callback in glutEvent.cpp)
 ***********************************************************/
/* DEPRICATED, use glutMenuStatusFunc instead. */
void APIENTRY
glutMenuStateFunc(GLUTmenuStateCB menuStateFunc)
{
  gState.menuStatus = (GLUTmenuStatusCB) menuStateFunc;
}

void APIENTRY
glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc)
{
  gState.menuStatus = menuStatusFunc;
}

void APIENTRY
glutIdleFunc(GLUTidleCB idleFunc)
{
  gState.idle = idleFunc;
}

/***********************************************************
 *	Unsupported callbacks
 ***********************************************************/
void APIENTRY
glutOverlayDisplayFunc(GLUTdisplayCB displayFunc)
{
}

void APIENTRY
glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc)
{
}

void APIENTRY
glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc)
{
}

void APIENTRY
glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc)
{
}

void APIENTRY
glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc)
{
}

void APIENTRY
glutDialsFunc(GLUTdialsCB dialsFunc)
{
}

void APIENTRY
glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc)
{
}

void APIENTRY
glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc)
{
}