haiku: Fixed compiling without OpenGL support.

This commit is contained in:
Philipp Wiesemann
2017-07-07 23:00:22 +02:00
parent fb9c2939c2
commit c3bf69ca4b
4 changed files with 17 additions and 3 deletions

View File

@@ -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