glew: add recipe for version 1.11.0

This commit is contained in:
Jerome Duval
2014-08-20 19:45:43 +00:00
parent cfbc863b36
commit 1049bdd6a1
2 changed files with 193 additions and 0 deletions

View File

@@ -0,0 +1,108 @@
From ce5eed384ec6502f26461579139ee72dd5fc178e Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 20 Aug 2014 16:50:24 +0000
Subject: updated Haiku patch
diff --git a/src/glewinfo_haiku.cpp b/src/glewinfo_haiku.cpp
new file mode 100644
index 0000000..3d32d00
--- /dev/null
+++ b/src/glewinfo_haiku.cpp
@@ -0,0 +1,93 @@
+/*
+ * glewinfo Haiku glue code
+ * Copyright 2013 Kacper Kasper <kacperkasper@gmail.com>
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
+
+#include <Application.h>
+#include <Window.h>
+#include <GLView.h>
+
+class GLEWInfoView : public BGLView {
+public:
+ GLEWInfoView(BRect frame, uint32 type);
+ virtual void AttachedToWindow(void);
+
+ void ContextInit() { LockGL(); }
+ void ContextDestroy() { UnlockGL(); }
+};
+
+GLEWInfoView::GLEWInfoView(BRect frame, uint32 type)
+ : BGLView(frame, "GLEWInfoView", B_FOLLOW_ALL_SIDES, 0, type)
+{
+}
+
+void GLEWInfoView::AttachedToWindow(void)
+{
+ LockGL();
+ BGLView::AttachedToWindow();
+ UnlockGL();
+}
+
+class GLEWInfoWindow : public BWindow {
+public:
+ GLEWInfoWindow(BRect frame, uint32 type);
+ virtual bool QuitRequested();
+
+private:
+ GLEWInfoView *view;
+};
+
+GLEWInfoWindow::GLEWInfoWindow(BRect frame, uint32 type)
+ : BWindow(frame, "GLEWInfoWindow", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE)
+{
+ AddChild(view = new GLEWInfoView(Bounds(), type));
+ view->ContextInit();
+}
+
+bool GLEWInfoWindow::QuitRequested()
+{
+ view->ContextDestroy();
+
+ view->RemoveSelf();
+
+ delete view;
+
+ return true;
+}
+
+class GLEWInfoApp : public BApplication
+{
+public:
+ GLEWInfoApp();
+ ~GLEWInfoApp();
+
+private:
+ GLEWInfoWindow *window;
+};
+
+GLEWInfoApp::GLEWInfoApp()
+ : BApplication("application/x-vnd.glew-GLEWInfo")
+{
+ BRect rect = BRect(0, 0, 1, 1);
+ window = new GLEWInfoWindow(rect, BGL_RGB | BGL_DOUBLE);
+}
+
+GLEWInfoApp::~GLEWInfoApp()
+{
+ window->Quit();
+}
+
+GLEWInfoApp *app;
+
+extern "C" GLboolean glewCreateContext ()
+{
+ app = new GLEWInfoApp();
+
+ return GL_FALSE;
+}
+
+extern "C" void glewDestroyContext ()
+{
+ delete app;
+}
--
1.8.3.4