aboutsummaryrefslogtreecommitdiff
path: root/platform/haiku/haiku_gl_view.cpp
blob: 61a012065671fa7adacf1ee80f644ade3a9ea5ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "haiku_gl_view.h"

HaikuGLView::HaikuGLView(BRect frame, uint32 type)
   : BGLView(frame, "SampleGLView", B_FOLLOW_ALL_SIDES, 0, type), rotate(0)
{
	width = frame.right-frame.left;
	height = frame.bottom-frame.top;
}

void HaikuGLView::AttachedToWindow(void)
{
	LockGL();
	BGLView::AttachedToWindow();
	UnlockGL();
	MakeFocus();
}

void HaikuGLView::FrameResized(float newWidth, float newHeight) 
{
}

void HaikuGLView::gDraw(float rotation)
{
}

void HaikuGLView::gReshape(int width, int height)
{
}

void HaikuGLView::Render(void)
{
	LockGL();
	SwapBuffers();
	UnlockGL();
}

void HaikuGLView::MessageReceived(BMessage * msg)
{
	switch (msg->what) {
	case 'rdrw':
		Render();
		/* Rotate a bit more */
		rotate++;
		break;

	default:	
		BGLView::MessageReceived(msg);
	}
}

void HaikuGLView::KeyDown(const char *bytes, int32 numBytes)
{

}