soreau / sdl Goto Github PK
View Code? Open in Web Editor NEWA cross-platform multimedia library designed to provide fast hardware access.
License: Other
A cross-platform multimedia library designed to provide fast hardware access.
License: Other
Simple DirectMedia Layer (SDL) Version 2.0 --- http://www.libsdl.org/ This is the Simple DirectMedia Layer, a general API that provides low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D framebuffer across multiple platforms. The current version supports Windows, Windows CE, Mac OS X, Linux, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, iOS, and Android. The code contains support for other operating systems but those are not officially supported. SDL is written in C, but works with C++ natively, and has bindings to several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, Go, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, Pike, Pliant, Python, Ruby, and Smalltalk. This library is distributed under the zlib license, which can be found in the file "COPYING". The best way to learn how to use SDL is to check out the header files in the "include" subdirectory and the programs in the "test" subdirectory. The header files and test programs are well commented and always up to date. More documentation and FAQs are available online at: http://wiki.libsdl.org/ If you need help with the library, or just want to discuss SDL related issues, you can join the developers mailing list: http://www.libsdl.org/mailing-list.php Enjoy! Sam Lantinga ([email protected])
Some applications, like xbmc depend on the video backend to handle mouse cursors (namely, hiding them and setting custom ones). Without it they crash. It should be possible to support this in the wayland backend.
Hey, Scott, we're looking to merge this into mainline SDL now. The guy that's merging it pointed out that there are LGPL headers on several files...they look like copy/pastes of headers that were on SDL 1.2, so it might not be a big deal, but we can't put this into SDL2 with those license headers. Would you mind if we removed them, so they fall under the zlib license with the rest of SDL2?
SDL2_image 2.0.0 doesn't build against this since the source is now months old. Could you please update it ?
I tried to merge changes from https://github.com/spurious/SDL-mirror but commits are not matching :(
I was able to build darkplaces engine r11979 and run xonotic with it using this patch:
diff --git a/makefile.inc b/makefile.inc
index 72d1856..68f4bfa 100644
--- a/makefile.inc
+++ b/makefile.inc
@@ -25,13 +25,13 @@ CC?=gcc
CPUOPTIMIZATIONS?=-fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math
# NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
-SDL_CONFIG?=sdl-config
+SDL_CONFIG?=sdl2-config
SDLCONFIG_UNIXCFLAGS?=`$(SDL_CONFIG) --cflags`
SDLCONFIG_UNIXCFLAGS_X11?=
SDLCONFIG_UNIXLIBS?=`$(SDL_CONFIG) --libs`
-SDLCONFIG_UNIXLIBS_X11?=-lX11
+SDLCONFIG_UNIXLIBS_X11?=-lGLESv2
SDLCONFIG_UNIXSTATICLIBS?=`$(SDL_CONFIG) --static-libs`
-SDLCONFIG_UNIXSTATICLIBS_X11?=-lX11
+SDLCONFIG_UNIXSTATICLIBS_X11?=-lGLESv2
SDLCONFIG_MACOSXCFLAGS=-I/Library/Frameworks/SDL.framework/Headers -I$(HOME)/Library/Frameworks/SDL.framework/Headers
SDLCONFIG_MACOSXLIBS=-F$(HOME)/Library/Frameworks/ -framework SDL -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS)
SDLCONFIG_MACOSXSTATICLIBS=-F$(HOME)/Library/Frameworks/ -framework SDL -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS)
@@ -171,7 +171,7 @@ OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_SND_COMMON) snd_sdl.
# Compilation
-CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_D3D) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES
+CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_D3D) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -DUSE_GLES2 -I/usr/include/SDL2 -D_REENTRANT
CFLAGS_DEBUG=-ggdb
CFLAGS_PROFILE=-g -pg -ggdb -fprofile-arcs
CFLAGS_RELEASE=
Used kernel-3.9.9+mesa-9.1.4(r600g)+wayland-1.2.0+weston-1.2.0, xonotic works, but mouse is almost not usable and when i tried making screenshots, switching screens and windows i got black screen and was forced to reboot.
Not sure if it is libsdl2, mesa, wayland, kernel or darkplaces bug, but please try building and testing it.
P.S. screenshots:
http://i.imgur.com/cXphkzX.jpg
http://i.imgur.com/1Lw5dpM.jpg
SDL video backends have a GetSysWMInfo hook to expose window system specific structures to clients that might want to use them. We should expose the following in case clients want to use functionality which SDL does not provide a suitable abstraction for, eg:
Currently PumpEvents polls the fd to see if there is any more data to be read without blocking. If there is it calls _dispatch (), if not, it calls _dispatch_pending ().
However, there is a possible condition where new events in the output buffer might need to be sent to the compositor in order to get back the events that we need to continue. In that case, we really need to dispatch pending events, cause any new requests to be buffered up, flush the buffer and then poll, so that we'll know if we need to read any more events in. Otherwise they might come a little bit late.
Currently, the SDL backend just creates a GL-api EGLContext. We should use EGL_OPENGL_ES_API when in OpenGL|ES mode.
Current cmake build system does not know about wayland, please update it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.