haiku: Fixed compiling without OpenGL support.
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
diff --git a/src/main/haiku/SDL_BApp.h b/src/main/haiku/SDL_BApp.h
index 871614b..9b5ea00 100644
--- a/src/main/haiku/SDL_BApp.h
+++ b/src/main/haiku/SDL_BApp.h
@@ -22,7 +22,9 @@
#define SDL_BAPP_H
#include <InterfaceKit.h>
+#if SDL_VIDEO_OPENGL
#include <OpenGLKit.h>
+#endif
#include "../../video/haiku/SDL_bkeyboard.h"
@@ -80,7 +82,9 @@ class SDL_BApp : public BApplication {
public:
SDL_BApp(const char* signature) :
BApplication(signature) {
+#if SDL_VIDEO_OPENGL
_current_context = NULL;
+#endif
}
@@ -188,6 +192,7 @@ public:
return _window_map[winID];
}
+#if SDL_VIDEO_OPENGL
void SetCurrentContext(BGLView *newContext) {
if(_current_context)
_current_context->UnlockGL();
@@ -195,6 +200,8 @@ public:
if (_current_context)
_current_context->LockGL();
}
+#endif
+
private:
/* Event management */
void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType) {
@@ -384,7 +391,9 @@ private:
/* Members */
std::vector<SDL_Window*> _window_map; /* Keeps track of SDL_Windows by index-id */
+#if SDL_VIDEO_OPENGL
BGLView *_current_context;
+#endif
};
#endif
diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc
index 4cdb92b..0a0000e 100644
--- a/src/video/haiku/SDL_bopengl.cc
+++ b/src/video/haiku/SDL_bopengl.cc
@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
-#if SDL_VIDEO_DRIVER_HAIKU
+#if SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL
#include "SDL_bopengl.h"
@@ -171,6 +171,6 @@ void BE_GL_RebootContexts(_THIS) {
}
#endif
-#endif /* SDL_VIDEO_DRIVER_HAIKU */
+#endif /* SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL */
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/haiku/SDL_bopengl.h b/src/video/haiku/SDL_bopengl.h
index 84edb65..a8d2346 100644
--- a/src/video/haiku/SDL_bopengl.h
+++ b/src/video/haiku/SDL_bopengl.h
@@ -22,6 +22,8 @@
#ifndef SDL_BOPENGL_H
#define SDL_BOPENGL_H
+#if SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -46,6 +48,8 @@ extern void BE_GL_RebootContexts(_THIS);
}
#endif
+#endif /* SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL */
+
#endif
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc
index b67f617..ef43c2c 100644
--- a/src/video/haiku/SDL_bvideo.cc
+++ b/src/video/haiku/SDL_bvideo.cc
@@ -96,7 +96,7 @@ BE_CreateDevice(int devindex)
device->shape_driver.SetWindowShape = NULL;
device->shape_driver.ResizeWindowShape = NULL;
-
+#if SDL_VIDEO_OPENGL
device->GL_LoadLibrary = BE_GL_LoadLibrary;
device->GL_GetProcAddress = BE_GL_GetProcAddress;
device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
@@ -106,6 +106,7 @@ BE_CreateDevice(int devindex)
device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
device->GL_SwapWindow = BE_GL_SwapWindow;
device->GL_DeleteContext = BE_GL_DeleteContext;
+#endif
device->StartTextInput = BE_StartTextInput;
device->StopTextInput = BE_StopTextInput;