libsdl: Fix OpenGL (disable direct mode for BGLView)

This commit is contained in:
Gerasim Troeglazov
2020-05-19 20:38:40 +10:00
parent b38fa0e728
commit dd949fee0f
2 changed files with 103 additions and 27 deletions

View File

@@ -5,7 +5,7 @@ joystick, and graphics via OpenGL."
HOMEPAGE="http://www.libsdl.org/"
COPYRIGHT="1997-2012 Sam Lantinga"
LICENSE="GNU LGPL v2.1"
REVISION="15"
REVISION="16"
SOURCE_URI="http://www.libsdl.org/release/SDL-1.2.15.tar.gz"
CHECKSUM_SHA256="d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00"
SOURCE_DIR="SDL-$portVersion"

View File

@@ -1,4 +1,4 @@
From 147b0abca9a052f6067473729c1698c1e9768f3b Mon Sep 17 00:00:00 2001
From 52028fa20c3c87e7e320a0665cf94c84de09d7c2 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 22 Nov 2013 23:38:56 +0100
Subject: Remove Alsa and ESD detection
@@ -33,10 +33,10 @@ index 08c8e1e..84d9a55 100644
])
+AC_CONFIG_MACRO_DIR([acinclude])
--
2.19.0
2.26.0
From bbaeaaa75724b902268de2681591380d9e0d7dc9 Mon Sep 17 00:00:00 2001
From 19601bfe8a61929dc5e5bffc0ce791032d24d13d Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 22 Nov 2013 23:39:26 +0100
Subject: Fix samples vs bytes issues
@@ -64,10 +64,10 @@ index de635f8..7faf571 100644
{ sigset_t omask;
SDL_MaskSignals(&omask);
--
2.19.0
2.26.0
From 654866025eb475ce742f7c0cce9debe5cbb4d4a2 Mon Sep 17 00:00:00 2001
From f35babd06d0232d31a377f6e05557e2fc0166ee2 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 22 Nov 2013 23:40:12 +0100
Subject: Various fixes to the video code
@@ -144,10 +144,10 @@ index c32b661..a26f18b 100644
SDL_Win->SetXYOffset(cx, cy);
}
--
2.19.0
2.26.0
From 1bcb03eaf59ffc0ba2a81ad736e4afa55cb85ffb Mon Sep 17 00:00:00 2001
From 3a8e071ebd848afd5b1e185b74384cbcb37d7c5a Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 23 Nov 2013 11:59:00 +0100
Subject: Actually fix the sample vs bytes problem in audio driver.
@@ -198,10 +198,10 @@ index 7faf571..300bf03 100644
/* Subscribe to the audio stream (creates a new thread) */
{ sigset_t omask;
--
2.19.0
2.26.0
From 84dd81f7569d40ff3352011f042469ca2766da8e Mon Sep 17 00:00:00 2001
From 0b4e43c371de5699b410021caa74c9690da479d9 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 22 Dec 2013 18:37:30 -0700
Subject: Remove Haiku from specialized DECLSPEC definition
@@ -221,10 +221,10 @@ index 27e2f7b..d5e2f1f 100644
# define DECLSPEC
# else
--
2.19.0
2.26.0
From 325e27ac31b4247992e499034fffd0998a91623a Mon Sep 17 00:00:00 2001
From 87cfecc3ee01ea4843f77fff1d328936cdd6d0ec Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 5 Jan 2014 17:22:10 +0100
Subject: Change prefix from "be" to "os" for OpenGL includes
@@ -245,10 +245,10 @@ index f2b19a2..2cb94ee 100644
#include <support/UTF8.h>
--
2.19.0
2.26.0
From 5bd26a05fa2f260a67933eb32f00bd631bb3198a Mon Sep 17 00:00:00 2001
From 32bd8f08e15ab34abfa8dfdb4e050653e0493fcb Mon Sep 17 00:00:00 2001
From: Jonathan Schleifer <js@webkeks.org>
Date: Fri, 28 Mar 2014 18:04:12 +0100
Subject: Fix compilation on x86_64
@@ -380,10 +380,10 @@ index 7c71b00..f2fef10 100644
return 0;
}
--
2.19.0
2.26.0
From 7b2636d859f8c403b61403f67bc76bbea5e3dbd9 Mon Sep 17 00:00:00 2001
From 361e8774494b8ce68e609adca55917c19b35c548 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 20 Oct 2014 13:33:55 +0200
Subject: Fix problem with GL viewport
@@ -408,10 +408,10 @@ index 5d4077f..7e1bd38 100644
gl_flags = BGL_RGB;
if (_this->gl_config.double_buffer)
--
2.19.0
2.26.0
From 83aeeb90994f48dfadb94d61e18cb36e4d505aef Mon Sep 17 00:00:00 2001
From b8b9a74dbf782f65065da035789fddfc919222c5 Mon Sep 17 00:00:00 2001
From: Michael Lotz <mmlr@mlotz.ch>
Date: Tue, 27 Oct 2015 21:39:24 +0000
Subject: Avoid crashing on quit when SDL_Win was never initialized.
@@ -437,10 +437,10 @@ index 7e1bd38..818d1a0 100644
if ( SDL_BlankCursor != NULL ) {
BE_FreeWMCursor(_this, SDL_BlankCursor);
--
2.19.0
2.26.0
From 78766f233fcf2f572e83d88f697c1c6a636c5242 Mon Sep 17 00:00:00 2001
From 45fd89b3f39103aa48bc4c899bb259ceee016d3d Mon Sep 17 00:00:00 2001
From: Michael Lotz <mmlr@mlotz.ch>
Date: Tue, 27 Oct 2015 21:40:36 +0000
Subject: Add 24 bit color spaces to ColorSpaceToBitsPerPixel().
@@ -464,10 +464,10 @@ index 818d1a0..0100f3b 100644
case B_RGBA32:
case B_RGB32_BIG:
--
2.19.0
2.26.0
From f28728f746a43489a297dee56c637118e5c60260 Mon Sep 17 00:00:00 2001
From 1819548d78a438eda8cfb07c5c839e4e366a9c41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Mon, 11 Jul 2016 15:08:06 +0200
Subject: Try to find correct application signature from app resources
@@ -516,10 +516,10 @@ index 8b79377..65a6dbf 100644
App->Run();
delete App;
--
2.19.0
2.26.0
From b35fcca512ede0bd470f93319a8d8309bc3ba006 Mon Sep 17 00:00:00 2001
From b2cb262190e7f10809d6fdfde382d0f28e25bcfb Mon Sep 17 00:00:00 2001
From: Peter Kosyh <p.kosyh@gmail.com>
Date: Fri, 5 Oct 2018 17:39:06 +0300
Subject: fix black box in top-left corner while win lost mouse focus
@@ -550,10 +550,10 @@ index 9e12750..63afded 100644
}
--
2.19.0
2.26.0
From 9fa69e45f9b169e37897edfceaa852d6dd884cc0 Mon Sep 17 00:00:00 2001
From 89bab4cb82d25d2ea02e3f849a23b711a2219313 Mon Sep 17 00:00:00 2001
From: Peter Kosyh <p.kosyh@gmail.com>
Date: Sat, 6 Oct 2018 14:17:22 +0300
Subject: libsdl: mouse wheel inverted
@@ -579,5 +579,81 @@ index 63afded..225e882 100644
}
break;
--
2.19.0
2.26.0
From 45835affbca3b752da33aae35eea331fba0e0327 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Tue, 19 May 2020 18:10:45 +1000
Subject: Disable direct mode for BGLView
diff --git a/src/video/bwindow/SDL_BWin.h b/src/video/bwindow/SDL_BWin.h
index 2cb94ee..d6b6b3c 100644
--- a/src/video/bwindow/SDL_BWin.h
+++ b/src/video/bwindow/SDL_BWin.h
@@ -25,6 +25,8 @@
#include "SDL_config.h"
+#define B_GL_DIRECT_WINDOW_DISABLE 1
+
#include <stdio.h>
#include <AppKit.h>
#include <InterfaceKit.h>
@@ -114,7 +116,9 @@ public:
SDL_GLView = new BGLView(Bounds(), "SDL GLView",
B_FOLLOW_ALL_SIDES, (B_WILL_DRAW|B_FRAME_EVENTS),
gl_flags|BGL_DOUBLE);
+#ifndef B_GL_DIRECT_WINDOW_DISABLE
SDL_GLView->EnableDirectMode(true);
+#endif
}
if ( the_view != SDL_GLView ) {
if ( the_view ) {
@@ -140,11 +144,6 @@ public:
the_view = SDL_View;
}
}
-#if SDL_VIDEO_OPENGL
- if ( the_view == SDL_GLView ) {
- SDL_GLView->UnlockGL();
- }
-#endif
Unlock();
return(retval);
}
@@ -216,10 +215,12 @@ public:
the application should respond to the quit request,
or ignore it as desired.
*/
+#ifndef B_GL_DIRECT_WINDOW_DISABLE
#if SDL_VIDEO_OPENGL
if ( SDL_GLView != NULL ) {
SDL_GLView->EnableDirectMode(false);
}
+#endif
#endif
return(false);
}
diff --git a/src/video/bwindow/SDL_sysevents.cc b/src/video/bwindow/SDL_sysevents.cc
index 225e882..38ce3c9 100644
--- a/src/video/bwindow/SDL_sysevents.cc
+++ b/src/video/bwindow/SDL_sysevents.cc
@@ -408,10 +408,12 @@ void SDL_BWin::DirectConnected(direct_buffer_info *info) {
default:
break;
}
+#ifndef B_GL_DIRECT_WINDOW_DISABLE
#if SDL_VIDEO_OPENGL
// If it is a BGLView, it is apparently required to
// call DirectConnected() on it as well
if (this->the_view == this->SDL_GLView)
this->SDL_GLView->DirectConnected(info);
-#endif
+#endif
+#endif
}
--
2.26.0