diff options
| author | Kostadin Damyanov | 2015-06-11 22:57:41 +0300 |
|---|---|---|
| committer | Kostadin Damyanov | 2015-06-11 22:57:41 +0300 |
| commit | 8df3e30abd06ce8d51e6b1ad696aabf97ea9f178 (patch) | |
| tree | 9ebc12296d6d0f3bf68a4debe050066bb9b8936b /platform/haiku/haiku_gl_view.cpp | |
| parent | f99b72c04f484c39ae728bc175114544a26d7bca (diff) | |
| download | godot-8df3e30abd06ce8d51e6b1ad696aabf97ea9f178.tar.gz godot-8df3e30abd06ce8d51e6b1ad696aabf97ea9f178.tar.zst godot-8df3e30abd06ce8d51e6b1ad696aabf97ea9f178.zip | |
Diffstat (limited to 'platform/haiku/haiku_gl_view.cpp')
| -rw-r--r-- | platform/haiku/haiku_gl_view.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/platform/haiku/haiku_gl_view.cpp b/platform/haiku/haiku_gl_view.cpp new file mode 100644 index 000000000..61a012065 --- /dev/null +++ b/platform/haiku/haiku_gl_view.cpp @@ -0,0 +1,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) +{ + +} |
