* 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.
*
* DESCRIPTION: the GlutWindow class saves all events for
* handling by main thread
***********************************************************/
#include <GL/glut.h>
#include <Window.h>
#include <GLView.h>
subwindows (handled as similarly as possible).
*/
class GlutWindow : public BGLView {
public:
GlutWindow(GlutWindow *nparent, const char *name, int x, int y, int width,
int height, ulong options);
virtual void MessageReceived(BMessage *message);
void KeyDown(const char *bytes, int32 numBytes);
void KeyUp(const char *bytes, int32 numBytes);
void MouseDown(BPoint point);
void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
void FrameResized(float width, float height);
void Draw(BRect updateRect);
void Pulse();
void MouseCheck();
void ErrorCallback(unsigned long errorCode);
static status_t MenuThread(void *menu);
int num;
int cursor;
#define GLUT_MAX_MENUS 3
int menu[GLUT_MAX_MENUS];
int m_width, m_height;
uint32 m_buttons;
GlutWindow *parent;
GlutWindow *children;
GlutWindow *siblings;
GLUTdisplayCB display;
GLUTreshapeCB reshape;
GLUTmouseCB mouse;
GLUTmotionCB motion;
GLUTpassiveCB passive;
GLUTentryCB entry;
GLUTkeyboardCB keyboard;
GLUTkeyboardCB keyboardUp;
GLUTvisibilityCB visibility;
GLUTspecialCB special;
GLUTspecialCB specialUp;
GLUTwindowStatusCB windowStatus;
bool anyevents;
bool displayEvent;
bool reshapeEvent;
bool mouseEvent;
bool motionEvent;
bool passiveEvent;
bool entryEvent;
bool keybEvent;
bool keybUpEvent;
bool windowStatusEvent;
bool specialEvent;
bool specialUpEvent;
bool statusEvent;
bool menuEvent;
int button, mouseState;
int mouseX, mouseY;
int motionX, motionY;
int passiveX, passiveY;
int entryState;
unsigned char key;
int keyX, keyY;
int visState;
int specialKey;
int specialX, specialY;
int modifierKeys;
int menuStatus;
int statusX, statusY;
int menuNumber;
int menuValue;
bool visible;
bool ignoreKeyRepeat;
};
* CLASS: GlutBWindow
*
* INHERITS FROM: BDirectWindow
*
* DESCRIPTION: basically a BWindow that won't quit
***********************************************************/
class GlutBWindow : public BDirectWindow {
public:
GlutBWindow(BRect frame, const char *name);
~GlutBWindow();
void DirectConnected(direct_buffer_info *info);
bool QuitRequested();
void Minimize(bool minimized);
void Hide();
void Show();
GlutWindow *bgl;
bool fConnectionDisabled;
};