mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 06:28:55 +02:00
Initial addition of sdljoytest.
This commit is contained in:
26
games-misc/sdljoytest/sdljoytest-11102003.bep
Normal file
26
games-misc/sdljoytest/sdljoytest-11102003.bep
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
DESCRIPTION="Simple Direct Media Layer"
|
||||||
|
HOMEPAGE="http://sdljoytest.sourceforge.net"
|
||||||
|
SRC_URI="http://sourceforge.net/projects/sdljoytest/files/sdljoytest/SDLJoytest-GL/SDLJoytest-GL-11102003.tar.bz2/download"
|
||||||
|
CHECKSUM_MD5="bd80f7a1537dc0e17c9d524f0b29f5ee"
|
||||||
|
REVISION="1"
|
||||||
|
STATUS_HAIKU="stable"
|
||||||
|
DEPEND=""
|
||||||
|
|
||||||
|
BUILD {
|
||||||
|
cd SDLJoytest-GL
|
||||||
|
sed -i 's/\-lpthread/ /' Makefile
|
||||||
|
make
|
||||||
|
}
|
||||||
|
|
||||||
|
INSTALL {
|
||||||
|
cd SDLJoytest-GL
|
||||||
|
BINDIR=${DESTDIR}`finddir B_COMMON_BIN_DIRECTORY`
|
||||||
|
MANDIR=${DESTDIR}`finddir B_COMMON_DATA_DIRECTORY`/man/man1
|
||||||
|
mkdir -p ${BINDIR}
|
||||||
|
mkdir -p ${MANDIR}
|
||||||
|
cp SDLJoytest-GL ${BINDIR}
|
||||||
|
cp SDLJoytest.1 ${DESTDIR}`finddir B_COMMON_DATA_DIRECTORY`/man/man1
|
||||||
|
}
|
||||||
|
|
||||||
|
LICENSE="GNU GPL v2"
|
||||||
|
COPYRIGHT="2003 Samuel E. Bray"
|
||||||
@@ -1,18 +1,27 @@
|
|||||||
diff -r 930614179450 libsdl-1.2-hg/src/video/bwindow/SDL_BWin.h
|
diff -Naur libsdl-1.2-hg/src/video/SDL_cursor.c libsdl-1.2-hg-haiku/src/video/SDL_cursor.c
|
||||||
--- libsdl-1.2-hg/src/video/bwindow/SDL_BWin.h Fri Dec 03 16:55:25 2010 -0800
|
--- libsdl-1.2-hg/src/video/SDL_cursor.c 2011-05-02 18:59:37.000000000 -0300
|
||||||
+++ libsdl-1.2-hg-haiku/src/video/bwindow/SDL_BWin.h Thu Dec 23 09:38:48 2010 +0000
|
+++ libsdl-1.2-hg-haiku/src/video/SDL_cursor.c 2011-05-02 19:01:04.324796416 -0300
|
||||||
@@ -113,7 +113,9 @@
|
@@ -729,6 +729,7 @@
|
||||||
|
if ( SDL_MUSTLOCK(screen) ) {
|
||||||
|
SDL_UnlockSurface(screen);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
if ( (screen == SDL_VideoSurface) &&
|
||||||
|
((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) {
|
||||||
|
SDL_VideoDevice *video = current_video;
|
||||||
|
diff -Naur libsdl-1.2-hg/src/video/bwindow/SDL_BWin.h libsdl-1.2-hg-haiku/src/video/bwindow/SDL_BWin.h
|
||||||
|
--- libsdl-1.2-hg/src/video/bwindow/SDL_BWin.h 2011-05-02 18:59:38.000000000 -0300
|
||||||
|
+++ libsdl-1.2-hg-haiku/src/video/bwindow/SDL_BWin.h 2011-05-02 19:04:14.842792960 -0300
|
||||||
|
@@ -112,7 +112,7 @@
|
||||||
|
if ( SDL_GLView == NULL ) {
|
||||||
SDL_GLView = new BGLView(Bounds(), "SDL GLView",
|
SDL_GLView = new BGLView(Bounds(), "SDL GLView",
|
||||||
B_FOLLOW_ALL_SIDES, (B_WILL_DRAW|B_FRAME_EVENTS),
|
B_FOLLOW_ALL_SIDES, (B_WILL_DRAW|B_FRAME_EVENTS),
|
||||||
gl_flags);
|
- gl_flags);
|
||||||
- SDL_GLView->EnableDirectMode(true);
|
+ gl_flags|BGL_DOUBLE);
|
||||||
+ //TODO: Figure out why directmode isn't working
|
SDL_GLView->EnableDirectMode(true);
|
||||||
+ //SDL_GLView->EnableDirectMode(true);
|
|
||||||
+ SDL_GLView->EnableDirectMode(false);
|
|
||||||
}
|
}
|
||||||
if ( the_view != SDL_GLView ) {
|
if ( the_view != SDL_GLView ) {
|
||||||
if ( the_view ) {
|
@@ -133,17 +133,17 @@
|
||||||
@@ -133,17 +135,17 @@
|
|
||||||
}
|
}
|
||||||
if ( the_view != SDL_View ) {
|
if ( the_view != SDL_View ) {
|
||||||
if ( the_view ) {
|
if ( the_view ) {
|
||||||
@@ -35,4 +44,69 @@ diff -r 930614179450 libsdl-1.2-hg/src/video/bwindow/SDL_BWin.h
|
|||||||
Unlock();
|
Unlock();
|
||||||
return(retval);
|
return(retval);
|
||||||
}
|
}
|
||||||
|
@@ -191,8 +191,8 @@
|
||||||
|
#if SDL_VIDEO_OPENGL
|
||||||
|
virtual void SwapBuffers(void) {
|
||||||
|
SDL_GLView->UnlockGL();
|
||||||
|
- SDL_GLView->LockGL();
|
||||||
|
SDL_GLView->SwapBuffers();
|
||||||
|
+ SDL_GLView->LockGL();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
virtual BView *View(void) {
|
||||||
|
@@ -215,6 +215,11 @@
|
||||||
|
the application should respond to the quit request,
|
||||||
|
or ignore it as desired.
|
||||||
|
*/
|
||||||
|
+#if SDL_VIDEO_OPENGL
|
||||||
|
+ if ( SDL_GLView != NULL ) {
|
||||||
|
+ SDL_GLView->EnableDirectMode(false);
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
return(true); /* Close the app window */
|
||||||
|
diff -Naur libsdl-1.2-hg/src/video/bwindow/SDL_sysevents.cc libsdl-1.2-hg-haiku/src/video/bwindow/SDL_sysevents.cc
|
||||||
|
--- libsdl-1.2-hg/src/video/bwindow/SDL_sysevents.cc 2011-05-02 18:59:38.000000000 -0300
|
||||||
|
+++ libsdl-1.2-hg-haiku/src/video/bwindow/SDL_sysevents.cc 2011-05-02 19:06:13.034865152 -0300
|
||||||
|
@@ -36,6 +36,7 @@
|
||||||
|
#include "../../events/SDL_sysevents.h"
|
||||||
|
#include "../../events/SDL_events_c.h"
|
||||||
|
#include "SDL_sysevents_c.h"
|
||||||
|
+#include "../SDL_cursor_c.h"
|
||||||
|
|
||||||
|
void BE_PumpEvents(_THIS)
|
||||||
|
{
|
||||||
|
@@ -203,11 +204,21 @@
|
||||||
|
if (transit == B_EXITED_VIEW) {
|
||||||
|
if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {
|
||||||
|
SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
|
||||||
|
+#if SDL_VIDEO_OPENGL
|
||||||
|
+ // for some reason, SDL_EraseCursor fails for OpenGL
|
||||||
|
+ if (this->the_view != this->SDL_GLView)
|
||||||
|
+#endif
|
||||||
|
+ SDL_EraseCursor(SDL_VideoSurface);
|
||||||
|
be_app->SetCursor(B_HAND_CURSOR);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
|
||||||
|
SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
|
||||||
|
+#if SDL_VIDEO_OPENGL
|
||||||
|
+ // for some reason, SDL_EraseCursor fails for OpenGL
|
||||||
|
+ if (this->the_view != this->SDL_GLView)
|
||||||
|
+#endif
|
||||||
|
+ SDL_EraseCursor(SDL_VideoSurface);
|
||||||
|
SDL_SetCursor(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -395,4 +406,10 @@
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
+#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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user