mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 19:50:05 +02:00
libsdl2: bump version
use a BLooper for events instead of a BApplication. BApplication is created on demand. remove upstreamed patches
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
SUMMARY="Simple Direct Media Layer 2.0"
|
||||
DESCRIPTION="Simple DirectMedia Layer is a cross-platform development library \
|
||||
designed to provide low level access to audio, keyboard, mouse, joystick, and \
|
||||
graphics hardware via OpenGL and Direct3D. It is used by video playback \
|
||||
software, emulators, and popular games."
|
||||
HOMEPAGE="https://www.libsdl.org/"
|
||||
COPYRIGHT="1997-2021 Sam Lantinga"
|
||||
LICENSE="Zlib"
|
||||
REVISION="6"
|
||||
SOURCE_URI="https://www.libsdl.org/release/SDL2-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="d8215b571a581be1332d2106f8036fcb03d12a70bae01e20f424976d275432bc"
|
||||
SOURCE_DIR="SDL2-$portVersion"
|
||||
PATCHES="libsdl2-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="all ?x86"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
||||
|
||||
PROVIDES="
|
||||
libsdl2$secondaryArchSuffix = $portVersion compat >= 2.0
|
||||
lib:libSDL2_2.0$secondaryArchSuffix = 0.14.0 compat >= 0
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libGL$secondaryArchSuffix
|
||||
lib:libglu$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
libsdl2${secondaryArchSuffix}_devel = $portVersion compat >= 2.0
|
||||
cmd:sdl2_config$secondaryArchSuffix = $portVersion compat >= 2.0
|
||||
devel:libSDL2$secondaryArchSuffix = 0.14.0 compat >= 0
|
||||
devel:libSDL2_2.0$secondaryArchSuffix = 0.14.0 compat >= 0
|
||||
"
|
||||
REQUIRES_devel="
|
||||
libsdl2$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libgl$secondaryArchSuffix
|
||||
devel:libglu$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:ninja
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cmake . -Bbuild -GNinja $cmakeDirArgs \
|
||||
-DSDL_STATIC=OFF -DRPATH=OFF
|
||||
ninja -C build
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
ninja -C build install
|
||||
|
||||
# devel package
|
||||
prepareInstalledDevelLibs \
|
||||
libSDL2 \
|
||||
libSDL2-2.0
|
||||
|
||||
fixPkgconfig
|
||||
fixDevelopLibDirReferences $binDir/sdl2-config
|
||||
|
||||
packageEntries devel \
|
||||
$developDir $binDir/sdl2-config $dataDir $libDir/cmake
|
||||
}
|
||||
@@ -6,18 +6,18 @@ software, emulators, and popular games."
|
||||
HOMEPAGE="https://www.libsdl.org/"
|
||||
COPYRIGHT="1997-2022 Sam Lantinga"
|
||||
LICENSE="Zlib"
|
||||
REVISION="3"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://www.libsdl.org/release/SDL2-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="c56aba1d7b5b0e7e999e4a7698c70b63a3394ff9704b5f6e1c57e0c16f04dd06"
|
||||
CHECKSUM_SHA256="1a0f686498fb768ad9f3f80b39037a7d006eac093aad39cb4ebcc832a8887231"
|
||||
SOURCE_DIR="SDL2-$portVersion"
|
||||
PATCHES="libsdl2-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="all"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
libsdl2$secondaryArchSuffix = $portVersion compat >= 2.0
|
||||
lib:libSDL2_2.0$secondaryArchSuffix = 0.18.2 compat >= 0
|
||||
lib:libSDL2_2.0$secondaryArchSuffix = 0.2600.4 compat >= 0
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
@@ -28,8 +28,8 @@ REQUIRES="
|
||||
PROVIDES_devel="
|
||||
libsdl2${secondaryArchSuffix}_devel = $portVersion compat >= 2.0
|
||||
cmd:sdl2_config$secondaryArchSuffix = $portVersion compat >= 2.0
|
||||
devel:libSDL2$secondaryArchSuffix = 0.18.2 compat >= 0
|
||||
devel:libSDL2_2.0$secondaryArchSuffix = 0.18.2 compat >= 0
|
||||
devel:libSDL2$secondaryArchSuffix = 0.2600.4 compat >= 0
|
||||
devel:libSDL2_2.0$secondaryArchSuffix = 0.2600.4 compat >= 0
|
||||
devel:libSDL2main$secondaryArchSuffix
|
||||
"
|
||||
REQUIRES_devel="
|
||||
@@ -63,7 +63,7 @@ INSTALL()
|
||||
|
||||
sed -i "s|.self/$relativeLibDir|.self/$relativeDevelopLibDir|" \
|
||||
$libDir/cmake/SDL2/SDL2mainTargets-release.cmake
|
||||
|
||||
rm $libDir/libSDL2_test.a
|
||||
|
||||
# devel package
|
||||
prepareInstalledDevelLibs \
|
||||
File diff suppressed because it is too large
Load Diff
439
media-libs/libsdl2/patches/libsdl2-2.26.4.patchset
Normal file
439
media-libs/libsdl2/patches/libsdl2-2.26.4.patchset
Normal file
@@ -0,0 +1,439 @@
|
||||
From 6fbc3b5f76680ccdd604c9822c4ab0d8b6a05b6d Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 12 Jan 2022 11:59:06 +1000
|
||||
Subject: Workaround for gcc2
|
||||
|
||||
|
||||
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
|
||||
index 5c3f012..6fc3c14 100644
|
||||
--- a/src/stdlib/SDL_string.c
|
||||
+++ b/src/stdlib/SDL_string.c
|
||||
@@ -33,6 +33,10 @@
|
||||
#include <psp2/kernel/clib.h>
|
||||
#endif
|
||||
|
||||
+#if __GNUC__ == 2
|
||||
+#define va_copy(to, from) __va_copy(to, from)
|
||||
+#endif
|
||||
+
|
||||
#if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOL) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) || !defined(HAVE_STRTOLL) || !defined(HAVE_STRTOULL)
|
||||
#define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F'))
|
||||
#define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f'))
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From bc391bc6d7ff37f9b73c2c9bbe466ef64bc8ca0c Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Wed, 29 Mar 2023 21:28:21 +0200
|
||||
Subject: Haiku: use a BLooper for events.
|
||||
|
||||
only create a BApplication when it doesn't already exist.
|
||||
|
||||
diff --git a/src/main/haiku/SDL_BApp.h b/src/main/haiku/SDL_BApp.h
|
||||
index 868b4ed..f7d7af4 100644
|
||||
--- a/src/main/haiku/SDL_BApp.h
|
||||
+++ b/src/main/haiku/SDL_BApp.h
|
||||
@@ -53,6 +53,7 @@ extern "C" {
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
+class SDL_BLooper;
|
||||
class SDL_BWin;
|
||||
|
||||
/* Message constants */
|
||||
@@ -78,32 +79,24 @@ enum ToSDL {
|
||||
};
|
||||
|
||||
|
||||
+extern "C" SDL_BLooper *SDL_Looper;
|
||||
|
||||
-/* Create a descendant of BApplication */
|
||||
-class SDL_BApp : public BApplication {
|
||||
+
|
||||
+/* Create a descendant of BLooper */
|
||||
+class SDL_BLooper : public BLooper {
|
||||
public:
|
||||
- SDL_BApp(const char* signature) :
|
||||
- BApplication(signature) {
|
||||
+ SDL_BLooper(const char* name) :
|
||||
+ BLooper(name) {
|
||||
#if SDL_VIDEO_OPENGL
|
||||
_current_context = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
- virtual ~SDL_BApp() {
|
||||
+ virtual ~SDL_BLooper() {
|
||||
}
|
||||
|
||||
|
||||
- virtual void RefsReceived(BMessage* message) {
|
||||
- char filePath[512];
|
||||
- entry_ref entryRef;
|
||||
- for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) {
|
||||
- BPath referencePath = BPath(&entryRef);
|
||||
- SDL_SendDropFile(NULL, referencePath.Path());
|
||||
- }
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
/* Event-handling functions */
|
||||
virtual void MessageReceived(BMessage* message) {
|
||||
/* Sort out SDL-related messages */
|
||||
@@ -173,7 +166,7 @@ public:
|
||||
break;
|
||||
|
||||
default:
|
||||
- BApplication::MessageReceived(message);
|
||||
+ BLooper::MessageReceived(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/haiku/SDL_BeApp.cc b/src/main/haiku/SDL_BeApp.cc
|
||||
index 9acbc54..5dea3a4 100644
|
||||
--- a/src/main/haiku/SDL_BeApp.cc
|
||||
+++ b/src/main/haiku/SDL_BeApp.cc
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <storage/File.h>
|
||||
#include <unistd.h>
|
||||
|
||||
-#include "SDL_BApp.h" /* SDL_BApp class definition */
|
||||
+#include "SDL_BApp.h" /* SDL_BLooper class definition */
|
||||
#include "SDL_BeApp.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_error.h"
|
||||
@@ -44,13 +44,39 @@ extern "C" {
|
||||
|
||||
#include "../../thread/SDL_systhread.h"
|
||||
|
||||
-/* Flag to tell whether or not the Be application is active or not */
|
||||
+/* Flag to tell whether or not the Be application and looper are active or not */
|
||||
static int SDL_BeAppActive = 0;
|
||||
static SDL_Thread *SDL_AppThread = NULL;
|
||||
+SDL_BLooper *SDL_Looper = NULL;
|
||||
+
|
||||
|
||||
/* Default application signature */
|
||||
const char *signature = "application/x-SDL-executable";
|
||||
|
||||
+
|
||||
+/* Create a descendant of BApplication */
|
||||
+class SDL_BApp : public BApplication {
|
||||
+public:
|
||||
+ SDL_BApp(const char* signature) :
|
||||
+ BApplication(signature) {
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ virtual ~SDL_BApp() {
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ virtual void RefsReceived(BMessage* message) {
|
||||
+ entry_ref entryRef;
|
||||
+ for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) {
|
||||
+ BPath referencePath = BPath(&entryRef);
|
||||
+ SDL_SendDropFile(NULL, referencePath.Path());
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+
|
||||
static int
|
||||
StartBeApp(void *unused)
|
||||
{
|
||||
@@ -78,35 +104,49 @@ StartBeApp(void *unused)
|
||||
return (0);
|
||||
}
|
||||
|
||||
-/* Initialize the Be Application, if it's not already started */
|
||||
-int
|
||||
-SDL_InitBeApp(void)
|
||||
+
|
||||
+static int
|
||||
+StartBeLooper()
|
||||
{
|
||||
- /* Create the BApplication that handles appserver interaction */
|
||||
- if (SDL_BeAppActive <= 0) {
|
||||
+ if (!be_app) {
|
||||
SDL_AppThread = SDL_CreateThreadInternal(StartBeApp, "SDLApplication", 0, NULL);
|
||||
if (SDL_AppThread == NULL) {
|
||||
return SDL_SetError("Couldn't create BApplication thread");
|
||||
}
|
||||
|
||||
- /* Change working directory to that of executable */
|
||||
- app_info info;
|
||||
- if (B_OK == be_app->GetAppInfo(&info)) {
|
||||
- entry_ref ref = info.ref;
|
||||
- BEntry entry;
|
||||
- if (B_OK == entry.SetTo(&ref)) {
|
||||
- BPath path;
|
||||
- if (B_OK == path.SetTo(&entry)) {
|
||||
- if (B_OK == path.GetParent(&path)) {
|
||||
- chdir(path.Path());
|
||||
- }
|
||||
+ do {
|
||||
+ SDL_Delay(10);
|
||||
+ } while ((be_app == NULL) || be_app->IsLaunching());
|
||||
+ }
|
||||
+
|
||||
+ /* Change working directory to that of executable */
|
||||
+ app_info info;
|
||||
+ if (B_OK == be_app->GetAppInfo(&info)) {
|
||||
+ entry_ref ref = info.ref;
|
||||
+ BEntry entry;
|
||||
+ if (B_OK == entry.SetTo(&ref)) {
|
||||
+ BPath path;
|
||||
+ if (B_OK == path.SetTo(&entry)) {
|
||||
+ if (B_OK == path.GetParent(&path)) {
|
||||
+ chdir(path.Path());
|
||||
}
|
||||
}
|
||||
}
|
||||
+ }
|
||||
|
||||
- do {
|
||||
- SDL_Delay(10);
|
||||
- } while ((be_app == NULL) || be_app->IsLaunching());
|
||||
+ SDL_Looper = new SDL_BLooper("SDLLooper");
|
||||
+ SDL_Looper->Run();
|
||||
+ return (0);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/* Initialize the Be Application, if it's not already started */
|
||||
+int
|
||||
+SDL_InitBeApp(void)
|
||||
+{
|
||||
+ /* Create the BApplication that handles appserver interaction */
|
||||
+ if (SDL_BeAppActive <= 0) {
|
||||
+ StartBeLooper();
|
||||
|
||||
/* Mark the application active */
|
||||
SDL_BeAppActive = 0;
|
||||
@@ -128,6 +168,9 @@ SDL_QuitBeApp(void)
|
||||
|
||||
/* If the reference count reached zero, clean up the app */
|
||||
if (SDL_BeAppActive == 0) {
|
||||
+ SDL_Looper->Lock();
|
||||
+ SDL_Looper->Quit();
|
||||
+ SDL_Looper = NULL;
|
||||
if (SDL_AppThread != NULL) {
|
||||
if (be_app != NULL) { /* Not tested */
|
||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||
@@ -144,7 +187,7 @@ SDL_QuitBeApp(void)
|
||||
#endif
|
||||
|
||||
/* SDL_BApp functions */
|
||||
-void SDL_BApp::ClearID(SDL_BWin *bwin) {
|
||||
+void SDL_BLooper::ClearID(SDL_BWin *bwin) {
|
||||
_SetSDLWindow(NULL, bwin->GetID());
|
||||
int32 i = _GetNumWindowSlots() - 1;
|
||||
while(i >= 0 && GetSDLWindow(i) == NULL) {
|
||||
diff --git a/src/video/haiku/SDL_BApp.h b/src/video/haiku/SDL_BApp.h
|
||||
index 868b4ed..f7d7af4 100644
|
||||
--- a/src/video/haiku/SDL_BApp.h
|
||||
+++ b/src/video/haiku/SDL_BApp.h
|
||||
@@ -53,6 +53,7 @@ extern "C" {
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
+class SDL_BLooper;
|
||||
class SDL_BWin;
|
||||
|
||||
/* Message constants */
|
||||
@@ -78,32 +79,24 @@ enum ToSDL {
|
||||
};
|
||||
|
||||
|
||||
+extern "C" SDL_BLooper *SDL_Looper;
|
||||
|
||||
-/* Create a descendant of BApplication */
|
||||
-class SDL_BApp : public BApplication {
|
||||
+
|
||||
+/* Create a descendant of BLooper */
|
||||
+class SDL_BLooper : public BLooper {
|
||||
public:
|
||||
- SDL_BApp(const char* signature) :
|
||||
- BApplication(signature) {
|
||||
+ SDL_BLooper(const char* name) :
|
||||
+ BLooper(name) {
|
||||
#if SDL_VIDEO_OPENGL
|
||||
_current_context = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
- virtual ~SDL_BApp() {
|
||||
+ virtual ~SDL_BLooper() {
|
||||
}
|
||||
|
||||
|
||||
- virtual void RefsReceived(BMessage* message) {
|
||||
- char filePath[512];
|
||||
- entry_ref entryRef;
|
||||
- for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) {
|
||||
- BPath referencePath = BPath(&entryRef);
|
||||
- SDL_SendDropFile(NULL, referencePath.Path());
|
||||
- }
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
/* Event-handling functions */
|
||||
virtual void MessageReceived(BMessage* message) {
|
||||
/* Sort out SDL-related messages */
|
||||
@@ -173,7 +166,7 @@ public:
|
||||
break;
|
||||
|
||||
default:
|
||||
- BApplication::MessageReceived(message);
|
||||
+ BLooper::MessageReceived(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff --git a/src/video/haiku/SDL_BWin.h b/src/video/haiku/SDL_BWin.h
|
||||
index e711ee0..d9f0340 100644
|
||||
--- a/src/video/haiku/SDL_BWin.h
|
||||
+++ b/src/video/haiku/SDL_BWin.h
|
||||
@@ -125,8 +125,8 @@ class SDL_BWin: public BWindow
|
||||
|
||||
#if SDL_VIDEO_OPENGL
|
||||
if (_SDL_GLView) {
|
||||
- if (((SDL_BApp*)be_app)->GetCurrentContext() == _SDL_GLView)
|
||||
- ((SDL_BApp*)be_app)->SetCurrentContext(NULL);
|
||||
+ if (SDL_Looper->GetCurrentContext() == _SDL_GLView)
|
||||
+ SDL_Looper->SetCurrentContext(NULL);
|
||||
if (_SDL_GLView == _cur_view)
|
||||
RemoveChild(_SDL_GLView);
|
||||
_SDL_GLView = NULL;
|
||||
@@ -205,8 +205,8 @@ class SDL_BWin: public BWindow
|
||||
void RemoveGLView() {
|
||||
Lock();
|
||||
if(_SDL_GLView != NULL) {
|
||||
- if (((SDL_BApp*)be_app)->GetCurrentContext() == _SDL_GLView)
|
||||
- ((SDL_BApp*)be_app)->SetCurrentContext(NULL);
|
||||
+ if (SDL_Looper->GetCurrentContext() == _SDL_GLView)
|
||||
+ SDL_Looper->SetCurrentContext(NULL);
|
||||
_SDL_GLView = NULL;
|
||||
UpdateCurrentView();
|
||||
// _SDL_GLView deleted by HAIKU_GL_DeleteContext
|
||||
@@ -549,7 +549,7 @@ private:
|
||||
if (keyUtf8 != NULL) {
|
||||
msg.AddData("key-utf8", B_INT8_TYPE, (const void*)keyUtf8, len);
|
||||
}
|
||||
- be_app->PostMessage(&msg);
|
||||
+ SDL_Looper->PostMessage(&msg);
|
||||
}
|
||||
|
||||
void _RepaintEvent() {
|
||||
@@ -559,7 +559,7 @@ private:
|
||||
}
|
||||
void _PostWindowEvent(BMessage &msg) {
|
||||
msg.AddInt32("window-id", _id);
|
||||
- be_app->PostMessage(&msg);
|
||||
+ SDL_Looper->PostMessage(&msg);
|
||||
}
|
||||
|
||||
/* Command methods (functions called upon by SDL) */
|
||||
diff --git a/src/video/haiku/SDL_bframebuffer.cc b/src/video/haiku/SDL_bframebuffer.cc
|
||||
index bf7a002..3c297a1 100644
|
||||
--- a/src/video/haiku/SDL_bframebuffer.cc
|
||||
+++ b/src/video/haiku/SDL_bframebuffer.cc
|
||||
@@ -39,8 +39,8 @@ static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
|
||||
return ((SDL_BWin*)(window->driverdata));
|
||||
}
|
||||
|
||||
-static SDL_INLINE SDL_BApp *_GetBeApp() {
|
||||
- return ((SDL_BApp*)be_app);
|
||||
+static SDL_INLINE SDL_BLooper *_GetBeLooper() {
|
||||
+ return SDL_Looper;
|
||||
}
|
||||
|
||||
int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window,
|
||||
diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc
|
||||
index 62ec4ec..5d44a88 100644
|
||||
--- a/src/video/haiku/SDL_bmodes.cc
|
||||
+++ b/src/video/haiku/SDL_bmodes.cc
|
||||
@@ -52,8 +52,8 @@ static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
|
||||
return ((SDL_BWin*)(window->driverdata));
|
||||
}
|
||||
|
||||
-static SDL_INLINE SDL_BApp *_GetBeApp() {
|
||||
- return ((SDL_BApp*)be_app);
|
||||
+static SDL_INLINE SDL_BLooper *_GetBeLooper() {
|
||||
+ return SDL_Looper;
|
||||
}
|
||||
|
||||
static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) {
|
||||
diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc
|
||||
index d1ab6b8..f64ca2f 100644
|
||||
--- a/src/video/haiku/SDL_bopengl.cc
|
||||
+++ b/src/video/haiku/SDL_bopengl.cc
|
||||
@@ -39,8 +39,8 @@ static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
|
||||
return ((SDL_BWin*)(window->driverdata));
|
||||
}
|
||||
|
||||
-static SDL_INLINE SDL_BApp *_GetBeApp() {
|
||||
- return ((SDL_BApp*)be_app);
|
||||
+static SDL_INLINE SDL_BLooper *_GetBeLooper() {
|
||||
+ return SDL_Looper;
|
||||
}
|
||||
|
||||
/* Passing a NULL path means load pointers from the application */
|
||||
@@ -97,7 +97,7 @@ int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
|
||||
return SDL_SetError("MakeCurrent failed");
|
||||
}
|
||||
}
|
||||
- _GetBeApp()->SetCurrentContext(glView);
|
||||
+ _GetBeLooper()->SetCurrentContext(glView);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window) {
|
||||
}
|
||||
#endif
|
||||
bwin->CreateGLView(gl_flags);
|
||||
- _GetBeApp()->SetCurrentContext(bwin->GetGLView());
|
||||
+ _GetBeLooper()->SetCurrentContext(bwin->GetGLView());
|
||||
return (SDL_GLContext)(bwin->GetGLView());
|
||||
}
|
||||
|
||||
diff --git a/src/video/haiku/SDL_bwindow.cc b/src/video/haiku/SDL_bwindow.cc
|
||||
index a9cc173..b79f34b 100644
|
||||
--- a/src/video/haiku/SDL_bwindow.cc
|
||||
+++ b/src/video/haiku/SDL_bwindow.cc
|
||||
@@ -37,8 +37,8 @@ static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
|
||||
return ((SDL_BWin*)(window->driverdata));
|
||||
}
|
||||
|
||||
-static SDL_INLINE SDL_BApp *_GetBeApp() {
|
||||
- return ((SDL_BApp*)be_app);
|
||||
+static SDL_INLINE SDL_BLooper *_GetBeLooper() {
|
||||
+ return SDL_Looper;
|
||||
}
|
||||
|
||||
static int _InitWindow(_THIS, SDL_Window *window) {
|
||||
@@ -71,7 +71,7 @@ static int _InitWindow(_THIS, SDL_Window *window) {
|
||||
return -1;
|
||||
|
||||
window->driverdata = bwin;
|
||||
- int32 winID = _GetBeApp()->GetID(window);
|
||||
+ int32 winID = _GetBeLooper()->GetID(window);
|
||||
bwin->SetID(winID);
|
||||
|
||||
return 0;
|
||||
@@ -218,7 +218,7 @@ void HAIKU_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) {
|
||||
|
||||
void HAIKU_DestroyWindow(_THIS, SDL_Window * window) {
|
||||
_ToBeWin(window)->LockLooper(); /* This MUST be locked */
|
||||
- _GetBeApp()->ClearID(_ToBeWin(window));
|
||||
+ _GetBeLooper()->ClearID(_ToBeWin(window));
|
||||
_ToBeWin(window)->Quit();
|
||||
window->driverdata = NULL;
|
||||
}
|
||||
--
|
||||
2.37.3
|
||||
|
||||
Reference in New Issue
Block a user