blob: 46f19796a7b9d171e0dad471e858dd75c3b64cb9 [file] [log] [blame]
jtgafb833d1999-08-19 00:55:39 +00001#ifndef __glutf90_h__
2#define __glutf90_h__
3
4/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */
5
6/* This program is freely distributable without licensing fees
7 and is provided without guarantee or warrantee expressed or
8 implied. This program is -not- in the public domain. */
9
10/* This header provides the binding interface for William Mitchell's
11 f90gl Fortran 90 GLUT binding. Other GLUT language bindings
12 can and should use this interace. */
13
14/* I appreciate the guidance from William Mitchell
15 (mitchell@cam.nist.gov) in developing this friend interface
16 for use by the f90gl package. See ../../README.fortran */
17
18#include <GL/glut.h>
19
20/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */
21/* NOTE These values are part of a binary interface for the f90gl Fortran
22 90 binding and so must NOT changes (additions are allowed). */
23
24/* GLUTwindow callbacks. */
25#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */
26#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */
27#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */
28#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */
29#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */
30#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */
31#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */
32#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */
33#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */
34#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */
35#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */
36#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */
37#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */
38#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */
39#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */
40#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */
41#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */
42#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */
43#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */
44#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */
45/* Non-GLUTwindow callbacks. */
46#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */
47#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */
48#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */
49
50/* GLUT Fortran callback function types. */
51typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void);
52typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *);
53/* NOTE the pressed key is int, not unsigned char for Fortran! */
54typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *);
55typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *);
56typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *);
57typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *);
58typedef void (GLUTCALLBACK *GLUTentryFCB) (int *);
59typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *);
60typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *);
61typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *);
62typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *);
63typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *);
64typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *);
65typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *);
66typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *);
67typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *);
68typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *);
69typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z);
70
71typedef void (GLUTCALLBACK *GLUTselectFCB) (int *);
72typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *);
73typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */
74typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *);
75typedef void (GLUTCALLBACK *GLUTidleFCB) (void);
76
77/* Functions that set and return Fortran callback functions. */
78extern void* GLUTAPIENTRY __glutGetFCB(int which);
79extern void GLUTAPIENTRY __glutSetFCB(int which, void *func);
80
81#endif /* __glutf90_h__ */