Skip to content
Snippets Groups Projects
flhack.h 3.76 KiB
#ifndef _FLHACK_H_
#define _FLHACK_H_

#ifdef WIN32
#include "winjunk.h"
#endif

#ifdef __APPLE__
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
#else
# include <GL/gl.h>
# include <GL/glu.h>
#endif

#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif

enum Fl_Event { // events
    FL_NO_EVENT = 0,
    FL_PUSH     = 1,
    FL_RELEASE  = 2,
    FL_ENTER        = 3,
    FL_LEAVE        = 4,
    FL_DRAG     = 5,
    FL_FOCUS        = 6,
    FL_UNFOCUS  = 7,
    FL_KEYBOARD = 8,
    FL_CLOSE        = 9,
    FL_MOVE     = 10,
    FL_SHORTCUT = 11,
    FL_DEACTIVATE   = 13,
    FL_ACTIVATE = 14,
    FL_HIDE     = 15,
    FL_SHOW     = 16,
    FL_PASTE        = 17,
    FL_SELECTIONCLEAR   = 18
};

enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut)
  FL_RGB	= 0,
  FL_INDEX	= 1,
  FL_SINGLE	= 0,
  FL_DOUBLE	= 2,
  FL_ACCUM	= 4,
  FL_ALPHA	= 8,
  FL_DEPTH	= 16,
  FL_STENCIL	= 32,
  FL_RGB8	= 64,
  FL_MULTISAMPLE= 128
};

// Fl::event_button():
#define FL_LEFT_MOUSE   1
#define FL_MIDDLE_MOUSE 2
#define FL_RIGHT_MOUSE  3

// Fl::event_state():
#define FL_SHIFT       0x00010000
#define FL_CAPS_LOCK   0x00020000
#define FL_CTRL        0x00040000
#define FL_ALT         0x00080000
#define FL_NUM_LOCK    0x00100000 // most X servers do this?
#define FL_META        0x00400000 // correct for XFree86
#define FL_SCROLL_LOCK 0x00800000 // correct for XFree86
#define FL_BUTTON1     0x01000000
#define FL_BUTTON2     0x02000000
#define FL_BUTTON3     0x04000000