haiku: Fixed compiling without OpenGL support.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Fri, 07 Jul 2017 23:00:22 +0200
changeset 11130898db1eb3e3a
parent 11129 4785560cdd03
child 11131 afa5670fa967
haiku: Fixed compiling without OpenGL support.
src/main/haiku/SDL_BApp.h
src/video/haiku/SDL_bopengl.cc
src/video/haiku/SDL_bopengl.h
src/video/haiku/SDL_bvideo.cc
     1.1 --- a/src/main/haiku/SDL_BApp.h	Fri Jul 07 23:00:10 2017 +0200
     1.2 +++ b/src/main/haiku/SDL_BApp.h	Fri Jul 07 23:00:22 2017 +0200
     1.3 @@ -22,7 +22,9 @@
     1.4  #define SDL_BAPP_H
     1.5  
     1.6  #include <InterfaceKit.h>
     1.7 +#if SDL_VIDEO_OPENGL
     1.8  #include <OpenGLKit.h>
     1.9 +#endif
    1.10  
    1.11  #include "../../video/haiku/SDL_bkeyboard.h"
    1.12  
    1.13 @@ -80,7 +82,9 @@
    1.14  public:
    1.15      SDL_BApp(const char* signature) :
    1.16          BApplication(signature) {
    1.17 +#if SDL_VIDEO_OPENGL
    1.18          _current_context = NULL;
    1.19 +#endif
    1.20      }
    1.21  
    1.22  
    1.23 @@ -188,6 +192,7 @@
    1.24          return _window_map[winID];
    1.25      }
    1.26  
    1.27 +#if SDL_VIDEO_OPENGL
    1.28      void SetCurrentContext(BGLView *newContext) {
    1.29          if(_current_context)
    1.30              _current_context->UnlockGL();
    1.31 @@ -195,6 +200,8 @@
    1.32          if (_current_context)
    1.33  	        _current_context->LockGL();
    1.34      }
    1.35 +#endif
    1.36 +
    1.37  private:
    1.38      /* Event management */
    1.39      void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType) {
    1.40 @@ -384,7 +391,9 @@
    1.41      /* Members */
    1.42      std::vector<SDL_Window*> _window_map; /* Keeps track of SDL_Windows by index-id */
    1.43  
    1.44 +#if SDL_VIDEO_OPENGL
    1.45      BGLView      *_current_context;
    1.46 +#endif
    1.47  };
    1.48  
    1.49  #endif
     2.1 --- a/src/video/haiku/SDL_bopengl.cc	Fri Jul 07 23:00:10 2017 +0200
     2.2 +++ b/src/video/haiku/SDL_bopengl.cc	Fri Jul 07 23:00:22 2017 +0200
     2.3 @@ -20,7 +20,7 @@
     2.4  */
     2.5  #include "../../SDL_internal.h"
     2.6  
     2.7 -#if SDL_VIDEO_DRIVER_HAIKU
     2.8 +#if SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL
     2.9  
    2.10  #include "SDL_bopengl.h"
    2.11  
    2.12 @@ -171,6 +171,6 @@
    2.13  }
    2.14  #endif
    2.15  
    2.16 -#endif /* SDL_VIDEO_DRIVER_HAIKU */
    2.17 +#endif /* SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL */
    2.18  
    2.19  /* vi: set ts=4 sw=4 expandtab: */
     3.1 --- a/src/video/haiku/SDL_bopengl.h	Fri Jul 07 23:00:10 2017 +0200
     3.2 +++ b/src/video/haiku/SDL_bopengl.h	Fri Jul 07 23:00:22 2017 +0200
     3.3 @@ -22,6 +22,8 @@
     3.4  #ifndef SDL_BOPENGL_H
     3.5  #define SDL_BOPENGL_H
     3.6  
     3.7 +#if SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL
     3.8 +
     3.9  #ifdef __cplusplus
    3.10  extern "C" {
    3.11  #endif
    3.12 @@ -46,6 +48,8 @@
    3.13  }
    3.14  #endif
    3.15  
    3.16 +#endif /* SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL */
    3.17 +
    3.18  #endif
    3.19  
    3.20  /* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/video/haiku/SDL_bvideo.cc	Fri Jul 07 23:00:10 2017 +0200
     4.2 +++ b/src/video/haiku/SDL_bvideo.cc	Fri Jul 07 23:00:22 2017 +0200
     4.3 @@ -96,7 +96,7 @@
     4.4      device->shape_driver.SetWindowShape = NULL;
     4.5      device->shape_driver.ResizeWindowShape = NULL;
     4.6  
     4.7 -
     4.8 +#if SDL_VIDEO_OPENGL
     4.9      device->GL_LoadLibrary = BE_GL_LoadLibrary;
    4.10      device->GL_GetProcAddress = BE_GL_GetProcAddress;
    4.11      device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
    4.12 @@ -106,6 +106,7 @@
    4.13      device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
    4.14      device->GL_SwapWindow = BE_GL_SwapWindow;
    4.15      device->GL_DeleteContext = BE_GL_DeleteContext;
    4.16 +#endif
    4.17  
    4.18      device->StartTextInput = BE_StartTextInput;
    4.19      device->StopTextInput = BE_StopTextInput;