1 /*
2  *   GRacer
3  *
4  *   Copyright (C) 1999 Takashi Matsuda <matsu@users.sourceforge.net>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  */
21 
22 #ifndef __GRACER_GR_H__
23 #define __GRACER_GR_H__
24 
25 #include <stdio.h>
26 #include <GL/gl.h>
27 #include <common/gr_scene.h>
28 #include "tcldefs.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 #if 0
34 }
35 #endif
36 
37 typedef struct {
38   char *name;
39   GLenum val;
40 } glWordList;
41 
42 typedef struct {
43   char *name;
44   void *val;
45 } glutWordList;
46 
47 typedef struct TclGlutCallback {
48   Tcl_Interp *interp;
49   Tcl_Obj *obj;
50   int value;
51 } TclGlutCallback;
52 
53 int	Glbind_Init		(Tcl_Interp *interp);
54 int	Glbind_SafeInit		(Tcl_Interp *interp);
55 
56 GLenum	GetGLEnum		(Tcl_Obj *CONST obj);
57 void*	GetGlutEnum		(Tcl_Obj *CONST obj);
58 
59 void	tcl_PutCache		(char *key, ClientData data);
60 ClientData tcl_GetCache		(char *key);
61 
62 void	tcl_DisplayFunc		(void);
63 void	tcl_ReshapeFunc		(int width, int height);
64 void	tcl_KeyboardFunc	(unsigned char key, int x, int y);
65 void	tcl_KeyboardUpFunc	(unsigned char key, int x, int y);
66 void	tcl_SpecialFunc		(int key, int x, int y);
67 void	tcl_SpecialUpFunc	(int key, int x, int y);
68 void	tcl_MouseFunc		(int button, int state, int x, int y);
69 void	tcl_MotionFunc		(int x, int y);
70 void	tcl_PassiveMotionFunc	(int x, int y);
71 void	tcl_EntryFunc		(int state);
72 void	tcl_VisibilityFunc	(int state);
73 void	tcl_TimerFunc		(int value);
74 void	tcl_IdleFunc		(void);
75 void	tcl_MenuStateFunc	(int state);
76 void	tcl_TabletMotionFunc	(int x, int y);
77 void	tcl_TabletButtonFunc	(int button, int state, int x, int y);
78 void	tcl_MenuStatusFunc	(int status, int x, int y);
79 void	tcl_WindowStatusFunc	(int state);
80 
81 void	tcl_GrSceneLoadTexture	(Tcl_Interp *interp,
82     				 char *baseurl,
83 				 GrScene *scene);
84 GrScene *tcl_GetGrScene		(Tcl_Interp *interp,
85 				 char *name,
86 				 char *baseurl);
87 
88 FILE*	gr_open_file		(char *url, char *mode);
89 char*	gr_get_fullurl		(char *url, char *baseurl);
90 
91 extern Tcl_Obj *obj_x;
92 extern Tcl_Obj *obj_y;
93 extern Tcl_Obj *obj_width;
94 extern Tcl_Obj *obj_height;
95 extern Tcl_Obj *obj_state;
96 extern Tcl_Obj *obj_status;
97 extern Tcl_Obj *obj_key;
98 extern Tcl_Obj *obj_button;
99 extern Tcl_Obj *obj_value;
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* __GRACER_GR_H__ */
106