haiku: Various fixes from haikuports.

Based on patch here:

https://github.com/haikuports/haikuports/blob/master/media-libs/libsdl2/patches/libsdl2-2.0.5.patchset
This commit is contained in:
Ryan C. Gordon
2017-05-01 18:39:05 -04:00
parent 444c47a1b8
commit 619ab7a22d
6 changed files with 42 additions and 17 deletions

View File

@@ -38,9 +38,9 @@ extern "C" {
#include <stdio.h>
#include <AppKit.h>
#include <InterfaceKit.h>
#include <be/game/DirectWindow.h>
#include <game/DirectWindow.h>
#if SDL_VIDEO_OPENGL
#include <be/opengl/GLView.h>
#include <opengl/GLView.h>
#endif
#include "SDL_events.h"
#include "../../main/haiku/SDL_BApp.h"

View File

@@ -94,7 +94,8 @@ int BE_GL_SwapWindow(_THIS, SDL_Window * window) {
}
int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
_GetBeApp()->SetCurrentContext(((SDL_BWin*)context)->GetGLView());
SDL_BWin* win = (SDL_BWin*)context;
_GetBeApp()->SetCurrentContext(win ? win->GetGLView() : NULL);
return 0;
}