2015-06-16 18:52:24 +00:00
|
|
|
#include "main/main.h"
|
2015-06-11 19:57:41 +00:00
|
|
|
#include "haiku_gl_view.h"
|
|
|
|
|
|
|
|
HaikuGLView::HaikuGLView(BRect frame, uint32 type)
|
2015-06-16 18:52:24 +00:00
|
|
|
: BGLView(frame, "SampleGLView", B_FOLLOW_ALL_SIDES, 0, type)
|
2015-06-11 19:57:41 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-06-16 18:52:24 +00:00
|
|
|
void HaikuGLView::AttachedToWindow(void) {
|
2015-06-11 19:57:41 +00:00
|
|
|
LockGL();
|
|
|
|
BGLView::AttachedToWindow();
|
|
|
|
UnlockGL();
|
|
|
|
MakeFocus();
|
|
|
|
}
|
|
|
|
|
2015-06-16 18:52:24 +00:00
|
|
|
void HaikuGLView::Draw(BRect updateRect) {
|
|
|
|
Main::force_redraw();
|
2015-06-11 19:57:41 +00:00
|
|
|
}
|
|
|
|
|
2015-06-16 18:52:24 +00:00
|
|
|
void HaikuGLView::MessageReceived(BMessage* msg)
|
2015-06-11 19:57:41 +00:00
|
|
|
{
|
2015-06-16 18:52:24 +00:00
|
|
|
// TODO: remove if not needed
|
2015-06-11 19:57:41 +00:00
|
|
|
switch (msg->what) {
|
2015-06-16 18:52:24 +00:00
|
|
|
default:
|
|
|
|
BGLView::MessageReceived(msg);
|
2015-06-11 19:57:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-16 18:52:24 +00:00
|
|
|
void HaikuGLView::MouseMoved (BPoint where, uint32 code, const BMessage *dragMessage) {
|
|
|
|
ERR_PRINT("MouseMoved()");
|
2015-06-11 19:57:41 +00:00
|
|
|
}
|