Merge branch 'development' into walkabout
Conflicts: Engine/source/T3D/aiPlayer.cpp
|
|
@ -82,6 +82,7 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#include "Opcode.h"
|
||||
#include <stdint.h>
|
||||
|
||||
using namespace Opcode;
|
||||
|
||||
|
|
@ -208,7 +209,7 @@ bool HybridModel::Build(const OPCODECREATE& create)
|
|||
Data->mLeaves[Data->mNbLeaves] = *current->GetAABB();
|
||||
|
||||
// Setup leaf data
|
||||
udword Index = (udword(current->GetPrimitives()) - udword(Data->mBase))/sizeof(udword);
|
||||
udword Index = (uintptr_t(current->GetPrimitives()) - uintptr_t(Data->mBase))/sizeof(uintptr_t);
|
||||
Data->mTriangles[Data->mNbLeaves].SetData(current->GetNbPrimitives(), Index);
|
||||
|
||||
Data->mNbLeaves++;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#include "Opcode.h"
|
||||
#include <stdint.h>
|
||||
|
||||
using namespace Opcode;
|
||||
|
||||
|
|
@ -163,7 +164,7 @@ bool SAP_PairData::Init(udword nb_objects)
|
|||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
inline_ void Remap(SAP_Element*& element, udword delta)
|
||||
{
|
||||
if(element) element = (SAP_Element*)(udword(element) + delta);
|
||||
if(element) element = (SAP_Element*)(element + delta);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -199,7 +200,7 @@ SAP_Element* SAP_PairData::GetFreeElem(udword id, SAP_Element* next, udword* rem
|
|||
|
||||
// Remap everything
|
||||
{
|
||||
udword Delta = udword(NewElems) - udword(mElementPool);
|
||||
udword Delta = uintptr_t(NewElems) - uintptr_t(mElementPool);
|
||||
|
||||
for(udword i=0;i<mNbUsedElements;i++) Remap(NewElems[i].mNext, Delta);
|
||||
for(udword i=0;i<mNbObjects;i++) Remap(mArray[i], Delta);
|
||||
|
|
|
|||
69
Engine/lib/sdl/Android.mk
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
###########################
|
||||
#
|
||||
# SDL shared library
|
||||
#
|
||||
###########################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := SDL2
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(subst $(LOCAL_PATH)/,, \
|
||||
$(wildcard $(LOCAL_PATH)/src/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
|
||||
$(LOCAL_PATH)/src/atomic/SDL_atomic.c \
|
||||
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
|
||||
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/events/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/file/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/power/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/filesystem/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/render/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/test/*.c))
|
||||
|
||||
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
|
||||
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
###########################
|
||||
#
|
||||
# SDL static library
|
||||
#
|
||||
###########################
|
||||
|
||||
LOCAL_MODULE := SDL2_static
|
||||
|
||||
LOCAL_MODULE_FILENAME := libSDL2
|
||||
|
||||
LOCAL_SRC_FILES += $(LOCAL_PATH)/src/main/android/SDL_android_main.c
|
||||
|
||||
LOCAL_LDLIBS :=
|
||||
LOCAL_EXPORT_LDLIBS := -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
16
Engine/lib/sdl/BUGS.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
Bugs are now managed in the SDL bug tracker, here:
|
||||
|
||||
http://bugzilla.libsdl.org/
|
||||
|
||||
You may report bugs there, and search to see if a given issue has already
|
||||
been reported, discussed, and maybe even fixed.
|
||||
|
||||
|
||||
You may also find help on the SDL mailing list. Subscription information:
|
||||
|
||||
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
||||
|
||||
Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
|
||||
bugs discussed on the mailing list may be forgotten or missed.
|
||||
|
||||
1309
Engine/lib/sdl/CMakeLists.txt
Normal file
20
Engine/lib/sdl/COPYING.txt
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
53
Engine/lib/sdl/CREDITS.txt
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
Simple DirectMedia Layer CREDITS
|
||||
Thanks to everyone who made this possible, including:
|
||||
|
||||
* Cliff Matthews, for giving me a reason to start this project. :)
|
||||
-- Executor rocks! *grin*
|
||||
|
||||
* Ryan Gordon for helping everybody out and keeping the dream alive. :)
|
||||
|
||||
* Gabriel Jacobo for his work on the Android port and generally helping out all around.
|
||||
|
||||
* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
|
||||
|
||||
* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
|
||||
|
||||
* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
|
||||
|
||||
* Alfred Reynolds for the game controller API and general (in)sanity
|
||||
|
||||
* Jørgen Tjernø for numerous magical Mac OS X fixes.
|
||||
|
||||
* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
|
||||
|
||||
* Julian Winter for the SDL 2.0 website.
|
||||
|
||||
* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
|
||||
|
||||
* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
|
||||
|
||||
* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
|
||||
|
||||
* Jim Grandpre for his work on multi-touch and gesture recognition during
|
||||
the Google Summer of Code 2010.
|
||||
|
||||
* Edgar "bobbens" Simo for his force feedback API development during the
|
||||
Google Summer of Code 2008.
|
||||
|
||||
* Aaron Wishnick for his work on audio resampling and pitch shifting during
|
||||
the Google Summer of Code 2008.
|
||||
|
||||
* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
|
||||
Google Summer of Code 2008.
|
||||
|
||||
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
|
||||
|
||||
* Everybody at Loki Software, Inc. for their great contributions!
|
||||
|
||||
And a big hand to everyone else who has contributed over the years.
|
||||
|
||||
THANKS! :)
|
||||
|
||||
-- Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
40
Engine/lib/sdl/INSTALL.txt
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
To compile and install SDL:
|
||||
|
||||
1. Windows with Visual Studio:
|
||||
* Read VisualC.html
|
||||
|
||||
Windows with gcc, either native or cross-compiling:
|
||||
* Read the FAQ at http://wiki.libsdl.org/moin.fcg/FAQWindows
|
||||
* Run './configure; make; make install'
|
||||
|
||||
Mac OS X with Xcode:
|
||||
* Read README-macosx.txt
|
||||
|
||||
Mac OS X from the command line:
|
||||
* Run './configure; make; make install'
|
||||
|
||||
Linux and other UNIX systems:
|
||||
* Run './configure; make; make install'
|
||||
|
||||
Android:
|
||||
* Read README-android.txt
|
||||
|
||||
iOS:
|
||||
* Read README-ios.txt
|
||||
|
||||
Using Cmake:
|
||||
* Read README-cmake.txt
|
||||
|
||||
2. Look at the example programs in ./test, and check out the online
|
||||
documentation at http://wiki.libsdl.org/
|
||||
|
||||
3. Join the SDL developer mailing list by sending E-mail to
|
||||
sdl-request@libsdl.org
|
||||
and put "subscribe" in the subject of the message.
|
||||
|
||||
Or alternatively you can use the web interface:
|
||||
http://www.libsdl.org/mailing-list.php
|
||||
|
||||
That's it!
|
||||
Sam Lantinga <slouken@libsdl.org>
|
||||
219
Engine/lib/sdl/Makefile.in
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
# Makefile to build and install the SDL library
|
||||
|
||||
top_builddir = .
|
||||
srcdir = @srcdir@
|
||||
objects = build
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
auxdir = @ac_aux_dir@
|
||||
distpath = $(srcdir)/..
|
||||
distdir = SDL2-@SDL_VERSION@
|
||||
distfile = $(distdir).tar.gz
|
||||
|
||||
@SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
CC = @CC@
|
||||
INCLUDE = @INCLUDE@
|
||||
CFLAGS = @BUILD_CFLAGS@
|
||||
EXTRA_CFLAGS = @EXTRA_CFLAGS@
|
||||
LDFLAGS = @BUILD_LDFLAGS@
|
||||
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
INSTALL = @INSTALL@
|
||||
AR = @AR@
|
||||
RANLIB = @RANLIB@
|
||||
WINDRES = @WINDRES@
|
||||
|
||||
TARGET = libSDL2.la
|
||||
OBJECTS = @OBJECTS@
|
||||
VERSION_OBJECTS = @VERSION_OBJECTS@
|
||||
|
||||
SDLMAIN_TARGET = libSDL2main.a
|
||||
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
|
||||
|
||||
SDLTEST_TARGET = libSDL2_test.a
|
||||
SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
|
||||
|
||||
SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake configure configure.in debian include Makefile.* sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC Xcode Xcode-iOS
|
||||
GEN_DIST = SDL2.spec
|
||||
|
||||
HDRS = \
|
||||
SDL.h \
|
||||
SDL_assert.h \
|
||||
SDL_atomic.h \
|
||||
SDL_audio.h \
|
||||
SDL_bits.h \
|
||||
SDL_blendmode.h \
|
||||
SDL_clipboard.h \
|
||||
SDL_cpuinfo.h \
|
||||
SDL_endian.h \
|
||||
SDL_error.h \
|
||||
SDL_events.h \
|
||||
SDL_filesystem.h \
|
||||
SDL_gamecontroller.h \
|
||||
SDL_gesture.h \
|
||||
SDL_haptic.h \
|
||||
SDL_hints.h \
|
||||
SDL_joystick.h \
|
||||
SDL_keyboard.h \
|
||||
SDL_keycode.h \
|
||||
SDL_loadso.h \
|
||||
SDL_log.h \
|
||||
SDL_main.h \
|
||||
SDL_messagebox.h \
|
||||
SDL_mouse.h \
|
||||
SDL_mutex.h \
|
||||
SDL_name.h \
|
||||
SDL_opengl.h \
|
||||
SDL_opengles.h \
|
||||
SDL_opengles2.h \
|
||||
SDL_pixels.h \
|
||||
SDL_platform.h \
|
||||
SDL_power.h \
|
||||
SDL_quit.h \
|
||||
SDL_rect.h \
|
||||
SDL_render.h \
|
||||
SDL_rwops.h \
|
||||
SDL_scancode.h \
|
||||
SDL_shape.h \
|
||||
SDL_stdinc.h \
|
||||
SDL_surface.h \
|
||||
SDL_system.h \
|
||||
SDL_syswm.h \
|
||||
SDL_thread.h \
|
||||
SDL_timer.h \
|
||||
SDL_touch.h \
|
||||
SDL_types.h \
|
||||
SDL_version.h \
|
||||
SDL_video.h \
|
||||
begin_code.h \
|
||||
close_code.h
|
||||
|
||||
SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
|
||||
|
||||
LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_RELEASE = @LT_RELEASE@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
|
||||
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
|
||||
|
||||
$(srcdir)/configure: $(srcdir)/configure.in
|
||||
@echo "Warning, configure.in is out of date"
|
||||
#(cd $(srcdir) && sh autogen.sh && sh configure)
|
||||
@sleep 3
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in
|
||||
$(SHELL) config.status $@
|
||||
|
||||
Makefile.in:;
|
||||
|
||||
$(objects):
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $@
|
||||
|
||||
update-revision:
|
||||
$(SHELL) $(auxdir)/updaterev.sh
|
||||
|
||||
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
|
||||
|
||||
$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
|
||||
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
|
||||
|
||||
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
|
||||
$(AR) cru $@ $(SDLMAIN_OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
|
||||
$(AR) cru $@ $(SDLTEST_OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
install: all install-bin install-hdrs install-lib install-data
|
||||
install-bin:
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
|
||||
$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
|
||||
install-hdrs: update-revision
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
|
||||
for file in $(HDRS) $(SDLTEST_HDRS); do \
|
||||
$(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
|
||||
done
|
||||
$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
|
||||
if test -f include/SDL_revision.h; then \
|
||||
$(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
|
||||
else \
|
||||
$(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
|
||||
fi
|
||||
|
||||
install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
|
||||
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
|
||||
$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
$(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
|
||||
$(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
|
||||
install-data:
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
|
||||
$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
|
||||
$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
|
||||
|
||||
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
|
||||
uninstall-bin:
|
||||
rm -f $(DESTDIR)$(bindir)/sdl2-config
|
||||
uninstall-hdrs:
|
||||
for file in $(HDRS) $(SDLTEST_HDRS); do \
|
||||
rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
|
||||
done
|
||||
rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
|
||||
rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
|
||||
-rmdir $(DESTDIR)$(includedir)/SDL2
|
||||
uninstall-lib:
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
|
||||
rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
|
||||
uninstall-data:
|
||||
rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
|
||||
rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
|
||||
|
||||
clean:
|
||||
rm -rf $(objects)
|
||||
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.rules sdl2-config
|
||||
rm -f config.status config.cache config.log libtool
|
||||
rm -rf $(srcdir)/autom4te*
|
||||
find $(srcdir) \( \
|
||||
-name '*~' -o \
|
||||
-name '*.bak' -o \
|
||||
-name '*.old' -o \
|
||||
-name '*.rej' -o \
|
||||
-name '*.orig' -o \
|
||||
-name '.#*' \) \
|
||||
-exec rm -f {} \;
|
||||
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
|
||||
|
||||
dist $(distfile):
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
|
||||
(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
|
||||
tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
|
||||
find $(distdir) \( \
|
||||
-name '*~' -o \
|
||||
-name '*.bak' -o \
|
||||
-name '*.old' -o \
|
||||
-name '*.rej' -o \
|
||||
-name '*.orig' -o \
|
||||
-name '.#*' \) \
|
||||
-exec rm -f {} \;
|
||||
if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
|
||||
(cd $(distdir); build-scripts/updaterev.sh)
|
||||
tar cvf - $(distdir) | gzip --best >$(distfile)
|
||||
rm -rf $(distdir)
|
||||
|
||||
rpm: $(distfile)
|
||||
rpmbuild -ta $?
|
||||
42
Engine/lib/sdl/Makefile.minimal
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# Makefile to build the SDL library
|
||||
|
||||
INCLUDE = -I./include
|
||||
CFLAGS = -g -O2 $(INCLUDE)
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
|
||||
TARGET = libSDL.a
|
||||
SOURCES = \
|
||||
src/*.c \
|
||||
src/audio/*.c \
|
||||
src/audio/dummy/*.c \
|
||||
src/cpuinfo/*.c \
|
||||
src/events/*.c \
|
||||
src/file/*.c \
|
||||
src/haptic/*.c \
|
||||
src/haptic/dummy/*.c \
|
||||
src/joystick/*.c \
|
||||
src/joystick/dummy/*.c \
|
||||
src/loadso/dummy/*.c \
|
||||
src/power/*.c \
|
||||
src/filesystem/dummy/*.c \
|
||||
src/render/*.c \
|
||||
src/render/software/*.c \
|
||||
src/stdlib/*.c \
|
||||
src/thread/*.c \
|
||||
src/thread/generic/*.c \
|
||||
src/timer/*.c \
|
||||
src/timer/dummy/*.c \
|
||||
src/video/*.c \
|
||||
src/video/dummy/*.c \
|
||||
|
||||
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(AR) crv $@ $^
|
||||
$(RANLIB) $@
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(OBJECTS)
|
||||
37
Engine/lib/sdl/Makefile.pandora
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Makefile to build the pandora SDL library
|
||||
|
||||
AR = arm-none-linux-gnueabi-ar
|
||||
RANLIB = arm-none-linux-gnueabi-ranlib
|
||||
CC = arm-none-linux-gnueabi-gcc
|
||||
CXX = arm-none-linux-gnueabi-g++
|
||||
STRIP = arm-none-linux-gnueabi-strip
|
||||
|
||||
CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \
|
||||
-mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \
|
||||
-I./include -I$(PNDSDK)/usr/include -DSDL_REVISION=0
|
||||
|
||||
TARGET = libSDL.a
|
||||
|
||||
SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
|
||||
./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
|
||||
./src/joystick/*.c ./src/haptic/*.c ./src/power/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
|
||||
./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
|
||||
./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
|
||||
./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
|
||||
./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
|
||||
./src/atomic/linux/*.c ./src/filesystem/unix/*.c \
|
||||
./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c
|
||||
|
||||
|
||||
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
|
||||
|
||||
CONFIG_H = $(shell cp include/SDL_config_pandora.h include/SDL_config.h && touch include/SDL_revision.h)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(CONFIG_H) $(OBJECTS)
|
||||
$(AR) crv $@ $^
|
||||
$(RANLIB) $@
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(OBJECTS)
|
||||
92
Engine/lib/sdl/Makefile.psp
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
TARGET_LIB = libSDL2.a
|
||||
OBJS= src/SDL.o \
|
||||
src/SDL_assert.o \
|
||||
src/SDL_error.o \
|
||||
src/SDL_hints.o \
|
||||
src/SDL_log.o \
|
||||
src/atomic/SDL_atomic.o \
|
||||
src/atomic/SDL_spinlock.o \
|
||||
src/audio/SDL_audio.o \
|
||||
src/audio/SDL_audiocvt.o \
|
||||
src/audio/SDL_audiodev.o \
|
||||
src/audio/SDL_audiotypecvt.o \
|
||||
src/audio/SDL_mixer.o \
|
||||
src/audio/SDL_wave.o \
|
||||
src/audio/psp/SDL_pspaudio.o \
|
||||
src/cpuinfo/SDL_cpuinfo.o \
|
||||
src/events/SDL_clipboardevents.o \
|
||||
src/events/SDL_dropevents.o \
|
||||
src/events/SDL_events.o \
|
||||
src/events/SDL_gesture.o \
|
||||
src/events/SDL_keyboard.o \
|
||||
src/events/SDL_mouse.o \
|
||||
src/events/SDL_quit.o \
|
||||
src/events/SDL_touch.o \
|
||||
src/events/SDL_windowevents.o \
|
||||
src/file/SDL_rwops.o \
|
||||
src/haptic/SDL_haptic.o \
|
||||
src/haptic/dummy/SDL_syshaptic.o \
|
||||
src/joystick/SDL_joystick.o \
|
||||
src/joystick/SDL_gamecontroller.o \
|
||||
src/joystick/psp/SDL_sysjoystick.o \
|
||||
src/power/SDL_power.o \
|
||||
src/power/psp/SDL_syspower.o \
|
||||
src/filesystem/dummy/SDL_sysfilesystem.o \
|
||||
src/render/SDL_render.o \
|
||||
src/render/SDL_yuv_sw.o \
|
||||
src/render/psp/SDL_render_psp.o \
|
||||
src/render/software/SDL_blendfillrect.o \
|
||||
src/render/software/SDL_blendline.o \
|
||||
src/render/software/SDL_blendpoint.o \
|
||||
src/render/software/SDL_drawline.o \
|
||||
src/render/software/SDL_drawpoint.o \
|
||||
src/render/software/SDL_render_sw.o \
|
||||
src/render/software/SDL_rotate.o \
|
||||
src/stdlib/SDL_getenv.o \
|
||||
src/stdlib/SDL_iconv.o \
|
||||
src/stdlib/SDL_malloc.o \
|
||||
src/stdlib/SDL_qsort.o \
|
||||
src/stdlib/SDL_stdlib.o \
|
||||
src/stdlib/SDL_string.o \
|
||||
src/thread/SDL_thread.o \
|
||||
src/thread/psp/SDL_syssem.o \
|
||||
src/thread/psp/SDL_systhread.o \
|
||||
src/thread/psp/SDL_sysmutex.o \
|
||||
src/thread/psp/SDL_syscond.o \
|
||||
src/timer/SDL_timer.o \
|
||||
src/timer/psp/SDL_systimer.o \
|
||||
src/video/SDL_RLEaccel.o \
|
||||
src/video/SDL_blit.o \
|
||||
src/video/SDL_blit_0.o \
|
||||
src/video/SDL_blit_1.o \
|
||||
src/video/SDL_blit_A.o \
|
||||
src/video/SDL_blit_N.o \
|
||||
src/video/SDL_blit_auto.o \
|
||||
src/video/SDL_blit_copy.o \
|
||||
src/video/SDL_blit_slow.o \
|
||||
src/video/SDL_bmp.o \
|
||||
src/video/SDL_clipboard.o \
|
||||
src/video/SDL_fillrect.o \
|
||||
src/video/SDL_pixels.o \
|
||||
src/video/SDL_rect.o \
|
||||
src/video/SDL_stretch.o \
|
||||
src/video/SDL_surface.o \
|
||||
src/video/SDL_video.o \
|
||||
src/video/psp/SDL_pspevents.o \
|
||||
src/video/psp/SDL_pspvideo.o \
|
||||
src/video/psp/SDL_pspgl.o \
|
||||
src/video/psp/SDL_pspmouse.o \
|
||||
|
||||
INCDIR = ./include
|
||||
CFLAGS = -g -O2 -G0 -Wall -D__PSP__ -DHAVE_OPENGL
|
||||
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
LIBDIR =
|
||||
LIBS = -lGL -lGLU -lglut -lz \
|
||||
-lpspvfpu -lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgum -lpspgu -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
|
||||
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -lpspvram
|
||||
|
||||
PSPSDK=$(shell psp-config --pspsdk-path)
|
||||
include $(PSPSDK)/lib/build.mak
|
||||
|
||||
61
Engine/lib/sdl/Makefile.wiz
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# Makefile to build the pandora SDL library
|
||||
WIZSDK = /mythtv/media/devel/toolchains/openwiz/arm-openwiz-linux-gnu
|
||||
|
||||
AR = $(WIZSDK)/bin/arm-openwiz-linux-gnu-ar
|
||||
RANLIB = $(WIZSDK)/bin/arm-openwiz-linux-gnu-ranlib
|
||||
CC = $(WIZSDK)/bin/arm-openwiz-linux-gnu-gcc
|
||||
CXX = $(WIZSDK)/bin/arm-openwiz-linux-gnu-g++
|
||||
STRIP = $(WIZSDK)/bin/arm-openwiz-linux-gnu-strip
|
||||
|
||||
CFLAGS = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE
|
||||
|
||||
TARGET_STATIC = libSDL13.a
|
||||
TARGET_SHARED = libSDL13.so
|
||||
|
||||
SOURCES = ./src/*.c ./src/audio/*.c ./src/cdrom/*.c ./src/cpuinfo/*.c ./src/events/*.c \
|
||||
./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
|
||||
./src/joystick/*.c ./src/haptic/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
|
||||
./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
|
||||
./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
|
||||
./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
|
||||
./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c ./src/cdrom/dummy/*.c \
|
||||
./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o
|
||||
|
||||
|
||||
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
|
||||
|
||||
all: config_copy $(TARGET_STATIC) $(TARGET_SHARED)
|
||||
|
||||
$(TARGET_STATIC): $(OBJECTS)
|
||||
$(AR) crv $@ $^
|
||||
$(RANLIB) $@
|
||||
|
||||
$(TARGET_SHARED):
|
||||
$(CC) -shared -Wl,-soname,$(TARGET_SHARED).0 -o $(TARGET_SHARED).0.0.1 $(OBJECTS)
|
||||
ln -s $(TARGET_SHARED).0.0.1 $(TARGET_SHARED).0
|
||||
ln -s $(TARGET_SHARED).0 $(TARGET_SHARED)
|
||||
|
||||
config_copy:
|
||||
cp include/SDL_config_wiz.h include/SDL_config.h
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET_STATIC) $(TARGET_SHARED)* $(OBJECTS)
|
||||
|
||||
install:
|
||||
mkdir -p $(WIZSDK)/lib
|
||||
mkdir -p $(WIZSDK)/include/SDL13
|
||||
cp -f $(TARGET_STATIC) $(WIZSDK)/lib
|
||||
cp -f $(TARGET_SHARED).0.0.1 $(WIZSDK)/lib
|
||||
rm -f $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
|
||||
ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0.0.1 $(WIZSDK)/lib/$(TARGET_SHARED).0
|
||||
ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
|
||||
|
||||
cp $(TARGET_STATIC) ../../toolchain/libs
|
||||
cp $(TARGET_SHARED).0.0.1 ../../toolchain/libs
|
||||
rm -f ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
|
||||
ln -s ../../toolchain/libs/$(TARGET_SHARED).0.0.1 ../../toolchain/libs/$(TARGET_SHARED).0
|
||||
ln -s ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
|
||||
|
||||
cp $(TARGET_SHARED).0.0.1 ../nehe_demos/build/$(TARGET_SHARED).0
|
||||
cp -f include/*.h $(WIZSDK)/include/SDL13/
|
||||
cp -f include/*.h ../../toolchain/include/SDL13/
|
||||
13
Engine/lib/sdl/README-SDL.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
Please distribute this file with the SDL runtime environment:
|
||||
|
||||
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
|
||||
designed to make it easy to write multi-media software, such as games and
|
||||
emulators.
|
||||
|
||||
The Simple DirectMedia Layer library source code is available from:
|
||||
http://www.libsdl.org/
|
||||
|
||||
This library is distributed under the terms of the zlib license:
|
||||
http://www.zlib.net/zlib_license.html
|
||||
|
||||
438
Engine/lib/sdl/README-android.txt
Normal file
|
|
@ -0,0 +1,438 @@
|
|||
================================================================================
|
||||
Simple DirectMedia Layer for Android
|
||||
================================================================================
|
||||
|
||||
Requirements:
|
||||
|
||||
Android SDK (version 12 or later)
|
||||
http://developer.android.com/sdk/index.html
|
||||
|
||||
Android NDK r7 or later
|
||||
http://developer.android.com/tools/sdk/ndk/index.html
|
||||
|
||||
Minimum API level supported by SDL: 10 (Android 2.3.3)
|
||||
Joystick support is available for API level >=12 devices.
|
||||
|
||||
================================================================================
|
||||
How the port works
|
||||
================================================================================
|
||||
|
||||
- Android applications are Java-based, optionally with parts written in C
|
||||
- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to
|
||||
the SDL library
|
||||
- This means that your application C code must be placed inside an Android
|
||||
Java project, along with some C support code that communicates with Java
|
||||
- This eventually produces a standard Android .apk package
|
||||
|
||||
The Android Java code implements an "Activity" and can be found in:
|
||||
android-project/src/org/libsdl/app/SDLActivity.java
|
||||
|
||||
The Java code loads your game code, the SDL shared library, and
|
||||
dispatches to native functions implemented in the SDL library:
|
||||
src/core/android/SDL_android.c
|
||||
|
||||
Your project must include some glue code that starts your main() routine:
|
||||
src/main/android/SDL_android_main.c
|
||||
|
||||
|
||||
================================================================================
|
||||
Building an app
|
||||
================================================================================
|
||||
|
||||
For simple projects you can use the script located at build-scripts/androidbuild.sh
|
||||
|
||||
There's two ways of using it:
|
||||
|
||||
androidbuild.sh com.yourcompany.yourapp < sources.list
|
||||
androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c
|
||||
|
||||
sources.list should be a text file with a source file name in each line
|
||||
Filenames should be specified relative to the current directory, for example if
|
||||
you are in the build-scripts directory and want to create the testgles.c test, you'll
|
||||
run:
|
||||
|
||||
./androidbuild.sh org.libsdl.testgles ../test/testgles.c
|
||||
|
||||
One limitation of this script is that all sources provided will be aggregated into
|
||||
a single directory, thus all your source files should have a unique name.
|
||||
|
||||
Once the project is complete the script will tell you where the debug APK is located.
|
||||
If you want to create a signed release APK, you can use the project created by this
|
||||
utility to generate it.
|
||||
|
||||
Finally, a word of caution: re running androidbuild.sh wipes any changes you may have
|
||||
done in the build directory for the app!
|
||||
|
||||
|
||||
For more complex projects, follow these instructions:
|
||||
|
||||
1. Copy the android-project directory wherever you want to keep your projects
|
||||
and rename it to the name of your project.
|
||||
2. Move or symlink this SDL directory into the <project>/jni directory
|
||||
3. Edit <project>/jni/src/Android.mk to include your source files
|
||||
4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
|
||||
|
||||
If you want to use the Eclipse IDE, skip to the Eclipse section below.
|
||||
|
||||
5. Create <project>/local.properties and use that to point to the Android SDK directory, by writing a line with the following form:
|
||||
sdk.dir=PATH_TO_ANDROID_SDK
|
||||
6. Run 'ant debug' in android/project. This compiles the .java and eventually
|
||||
creates a .apk with the native code embedded
|
||||
7. 'ant debug install' will push the apk to the device or emulator (if connected)
|
||||
|
||||
Here's an explanation of the files in the Android project, so you can customize them:
|
||||
|
||||
android-project/
|
||||
AndroidManifest.xml - package manifest. Among others, it contains the class name
|
||||
of the main Activity and the package name of the application.
|
||||
build.properties - empty
|
||||
build.xml - build description file, used by ant. The actual application name
|
||||
is specified here.
|
||||
default.properties - holds the target ABI for the application, android-10 and up
|
||||
project.properties - holds the target ABI for the application, android-10 and up
|
||||
local.properties - holds the SDK path, you should change this to the path to your SDK
|
||||
jni/ - directory holding native code
|
||||
jni/Android.mk - Android makefile that can call recursively the Android.mk files
|
||||
in all subdirectories
|
||||
jni/SDL/ - (symlink to) directory holding the SDL library files
|
||||
jni/SDL/Android.mk - Android makefile for creating the SDL shared library
|
||||
jni/src/ - directory holding your C/C++ source
|
||||
jni/src/Android.mk - Android makefile that you should customize to include your
|
||||
source code and any library references
|
||||
res/ - directory holding resources for your application
|
||||
res/drawable-* - directories holding icons for different phone hardware. Could be
|
||||
one dir called "drawable".
|
||||
res/layout/main.xml - Usually contains a file main.xml, which declares the screen layout.
|
||||
We don't need it because we use the SDL video output.
|
||||
res/values/strings.xml - strings used in your application, including the application name
|
||||
shown on the phone.
|
||||
src/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding
|
||||
to SDL. Be very careful changing this, as the SDL library relies
|
||||
on this implementation.
|
||||
|
||||
|
||||
================================================================================
|
||||
Build an app with static linking of libSDL
|
||||
================================================================================
|
||||
|
||||
This build uses the Android NDK module system.
|
||||
|
||||
Instructions:
|
||||
1. Copy the android-project directory wherever you want to keep your projects
|
||||
and rename it to the name of your project.
|
||||
2. Rename <project>/jni/src/Android_static.mk to <project>/jni/src/Android.mk
|
||||
(overwrite the existing one)
|
||||
3. Edit <project>/jni/src/Android.mk to include your source files
|
||||
4. create and export an environment variable named NDK_MODULE_PATH that points
|
||||
to the parent directory of this SDL directory. e.g.:
|
||||
|
||||
export NDK_MODULE_PATH="$PWD"/..
|
||||
|
||||
5. Edit <project>/src/org/libsdl/app/SDLActivity.java and remove the call to
|
||||
System.loadLibrary("SDL2") line 42.
|
||||
6. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
|
||||
|
||||
|
||||
================================================================================
|
||||
Customizing your application name
|
||||
================================================================================
|
||||
|
||||
To customize your application name, edit AndroidManifest.xml and replace
|
||||
"org.libsdl.app" with an identifier for your product package.
|
||||
|
||||
Then create a Java class extending SDLActivity and place it in a directory
|
||||
under src matching your package, e.g.
|
||||
src/com/gamemaker/game/MyGame.java
|
||||
|
||||
Here's an example of a minimal class file:
|
||||
--- MyGame.java --------------------------
|
||||
package com.gamemaker.game;
|
||||
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
/*
|
||||
* A sample wrapper class that just calls SDLActivity
|
||||
*/
|
||||
|
||||
public class MyGame extends SDLActivity { }
|
||||
|
||||
------------------------------------------
|
||||
|
||||
Then replace "SDLActivity" in AndroidManifest.xml with the name of your
|
||||
class, .e.g. "MyGame"
|
||||
|
||||
================================================================================
|
||||
Customizing your application icon
|
||||
================================================================================
|
||||
|
||||
Conceptually changing your icon is just replacing the "ic_launcher.png" files in
|
||||
the drawable directories under the res directory. There are four directories for
|
||||
different screen sizes. These can be replaced with one dir called "drawable",
|
||||
containing an icon file "ic_launcher.png" with dimensions 48x48 or 72x72.
|
||||
|
||||
You may need to change the name of your icon in AndroidManifest.xml to match
|
||||
this icon filename.
|
||||
|
||||
================================================================================
|
||||
Loading assets
|
||||
================================================================================
|
||||
|
||||
Any files you put in the "assets" directory of your android-project directory
|
||||
will get bundled into the application package and you can load them using the
|
||||
standard functions in SDL_rwops.h.
|
||||
|
||||
There are also a few Android specific functions that allow you to get other
|
||||
useful paths for saving and loading data:
|
||||
SDL_AndroidGetInternalStoragePath()
|
||||
SDL_AndroidGetExternalStorageState()
|
||||
SDL_AndroidGetExternalStoragePath()
|
||||
|
||||
See SDL_system.h for more details on these functions.
|
||||
|
||||
The asset packaging system will, by default, compress certain file extensions.
|
||||
SDL includes two asset file access mechanisms, the preferred one is the so
|
||||
called "File Descriptor" method, which is faster and doesn't involve the Dalvik
|
||||
GC, but given this method does not work on compressed assets, there is also the
|
||||
"Input Stream" method, which is automatically used as a fall back by SDL. You
|
||||
may want to keep this fact in mind when building your APK, specially when large
|
||||
files are involved.
|
||||
For more information on which extensions get compressed by default and how to
|
||||
disable this behaviour, see for example:
|
||||
|
||||
http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
|
||||
|
||||
================================================================================
|
||||
Pause / Resume behaviour
|
||||
================================================================================
|
||||
|
||||
If SDL is compiled with SDL_ANDROID_BLOCK_ON_PAUSE defined (the default),
|
||||
the event loop will block itself when the app is paused (ie, when the user
|
||||
returns to the main Android dashboard). Blocking is better in terms of battery
|
||||
use, and it allows your app to spring back to life instantaneously after resume
|
||||
(versus polling for a resume message).
|
||||
|
||||
Upon resume, SDL will attempt to restore the GL context automatically.
|
||||
In modern devices (Android 3.0 and up) this will most likely succeed and your
|
||||
app can continue to operate as it was.
|
||||
|
||||
However, there's a chance (on older hardware, or on systems under heavy load),
|
||||
where the GL context can not be restored. In that case you have to listen for
|
||||
a specific message, (which is not yet implemented!) and restore your textures
|
||||
manually or quit the app (which is actually the kind of behaviour you'll see
|
||||
under iOS, if the OS can not restore your GL context it will just kill your app)
|
||||
|
||||
================================================================================
|
||||
Threads and the Java VM
|
||||
================================================================================
|
||||
|
||||
For a quick tour on how Linux native threads interoperate with the Java VM, take
|
||||
a look here: http://developer.android.com/guide/practices/jni.html
|
||||
If you want to use threads in your SDL app, it's strongly recommended that you
|
||||
do so by creating them using SDL functions. This way, the required attach/detach
|
||||
handling is managed by SDL automagically. If you have threads created by other
|
||||
means and they make calls to SDL functions, make sure that you call
|
||||
Android_JNI_SetupThread before doing anything else otherwise SDL will attach
|
||||
your thread automatically anyway (when you make an SDL call), but it'll never
|
||||
detach it.
|
||||
|
||||
================================================================================
|
||||
Using STL
|
||||
================================================================================
|
||||
|
||||
You can use STL in your project by creating an Application.mk file in the jni
|
||||
folder and adding the following line:
|
||||
APP_STL := stlport_static
|
||||
|
||||
For more information check out CPLUSPLUS-SUPPORT.html in the NDK documentation.
|
||||
|
||||
================================================================================
|
||||
Additional documentation
|
||||
================================================================================
|
||||
|
||||
The documentation in the NDK docs directory is very helpful in understanding the
|
||||
build process and how to work with native code on the Android platform.
|
||||
|
||||
The best place to start is with docs/OVERVIEW.TXT
|
||||
|
||||
|
||||
================================================================================
|
||||
Using Eclipse
|
||||
================================================================================
|
||||
|
||||
First make sure that you've installed Eclipse and the Android extensions as described here:
|
||||
http://developer.android.com/tools/sdk/eclipse-adt.html
|
||||
|
||||
Once you've copied the SDL android project and customized it, you can create an Eclipse project from it:
|
||||
* File -> New -> Other
|
||||
* Select the Android -> Android Project wizard and click Next
|
||||
* Enter the name you'd like your project to have
|
||||
* Select "Create project from existing source" and browse for your project directory
|
||||
* Make sure the Build Target is set to Android 2.0
|
||||
* Click Finish
|
||||
|
||||
|
||||
================================================================================
|
||||
Using the emulator
|
||||
================================================================================
|
||||
|
||||
There are some good tips and tricks for getting the most out of the
|
||||
emulator here: http://developer.android.com/tools/devices/emulator.html
|
||||
|
||||
Especially useful is the info on setting up OpenGL ES 2.0 emulation.
|
||||
|
||||
Notice that this software emulator is incredibly slow and needs a lot of disk space.
|
||||
Using a real device works better.
|
||||
|
||||
================================================================================
|
||||
Troubleshooting
|
||||
================================================================================
|
||||
|
||||
You can create and run an emulator from the Eclipse IDE:
|
||||
* Window -> Android SDK and AVD Manager
|
||||
|
||||
You can see if adb can see any devices with the following command:
|
||||
adb devices
|
||||
|
||||
You can see the output of log messages on the default device with:
|
||||
adb logcat
|
||||
|
||||
You can push files to the device with:
|
||||
adb push local_file remote_path_and_file
|
||||
|
||||
You can push files to the SD Card at /sdcard, for example:
|
||||
adb push moose.dat /sdcard/moose.dat
|
||||
|
||||
You can see the files on the SD card with a shell command:
|
||||
adb shell ls /sdcard/
|
||||
|
||||
You can start a command shell on the default device with:
|
||||
adb shell
|
||||
|
||||
You can remove the library files of your project (and not the SDL lib files) with:
|
||||
ndk-build clean
|
||||
|
||||
You can do a build with the following command:
|
||||
ndk-build
|
||||
|
||||
You can see the complete command line that ndk-build is using by passing V=1 on the command line:
|
||||
ndk-build V=1
|
||||
|
||||
If your application crashes in native code, you can use addr2line to convert the
|
||||
addresses in the stack trace to lines in your code.
|
||||
|
||||
For example, if your crash looks like this:
|
||||
I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
|
||||
I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4
|
||||
I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c
|
||||
I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c
|
||||
I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030
|
||||
I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so
|
||||
I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so
|
||||
I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so
|
||||
I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so
|
||||
|
||||
You can see that there's a crash in the C library being called from the main code.
|
||||
I run addr2line with the debug version of my code:
|
||||
arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so
|
||||
and then paste in the number after "pc" in the call stack, from the line that I care about:
|
||||
000014bc
|
||||
|
||||
I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23.
|
||||
|
||||
You can add logging to your code to help show what's happening:
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x);
|
||||
|
||||
If you need to build without optimization turned on, you can create a file called
|
||||
"Application.mk" in the jni directory, with the following line in it:
|
||||
APP_OPTIM := debug
|
||||
|
||||
|
||||
================================================================================
|
||||
Memory debugging
|
||||
================================================================================
|
||||
|
||||
The best (and slowest) way to debug memory issues on Android is valgrind.
|
||||
Valgrind has support for Android out of the box, just grab code using:
|
||||
svn co svn://svn.valgrind.org/valgrind/trunk valgrind
|
||||
... and follow the instructions in the file README.android to build it.
|
||||
|
||||
One thing I needed to do on Mac OS X was change the path to the toolchain,
|
||||
and add ranlib to the environment variables:
|
||||
export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib
|
||||
|
||||
Once valgrind is built, you can create a wrapper script to launch your
|
||||
application with it, changing org.libsdl.app to your package identifier:
|
||||
--- start_valgrind_app -------------------
|
||||
#!/system/bin/sh
|
||||
export TMPDIR=/data/data/org.libsdl.app
|
||||
exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
|
||||
------------------------------------------
|
||||
|
||||
Then push it to the device:
|
||||
adb push start_valgrind_app /data/local
|
||||
|
||||
and make it executable:
|
||||
adb shell chmod 755 /data/local/start_valgrind_app
|
||||
|
||||
and tell Android to use the script to launch your application:
|
||||
adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app"
|
||||
|
||||
If the setprop command says "could not set property", it's likely that
|
||||
your package name is too long and you should make it shorter by changing
|
||||
AndroidManifest.xml and the path to your class file in android-project/src
|
||||
|
||||
You can then launch your application normally and waaaaaaaiiittt for it.
|
||||
You can monitor the startup process with the logcat command above, and
|
||||
when it's done (or even while it's running) you can grab the valgrind
|
||||
output file:
|
||||
adb pull /sdcard/valgrind.log
|
||||
|
||||
When you're done instrumenting with valgrind, you can disable the wrapper:
|
||||
adb shell setprop wrap.org.libsdl.app ""
|
||||
|
||||
================================================================================
|
||||
Why is API level 10 the minimum required?
|
||||
================================================================================
|
||||
|
||||
API level 10 is the minimum required level at runtime (that is, on the device)
|
||||
because SDL requires some functionality for running not
|
||||
available on older devices. Since the incorporation of joystick support into SDL,
|
||||
the minimum SDK required to *build* SDL is version 12. Devices running API levels
|
||||
10-11 are still supported, only with the joystick functionality disabled.
|
||||
|
||||
Support for native OpenGL ES and ES2 applications was introduced in the NDK for
|
||||
API level 4 and 8. EGL was made a stable API in the NDK for API level 9, which
|
||||
has since then been obsoleted, with the recommendation to developers to bump the
|
||||
required API level to 10.
|
||||
As of this writing, according to http://developer.android.com/about/dashboards/index.html
|
||||
about 90% of the Android devices accessing Google Play support API level 10 or
|
||||
higher (March 2013).
|
||||
|
||||
================================================================================
|
||||
A note regarding the use of the "dirty rectangles" rendering technique
|
||||
================================================================================
|
||||
|
||||
If your app uses a variation of the "dirty rectangles" rendering technique,
|
||||
where you only update a portion of the screen on each frame, you may notice a
|
||||
variety of visual glitches on Android, that are not present on other platforms.
|
||||
This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2
|
||||
contexts, in particular the use of the eglSwapBuffers function. As stated in the
|
||||
documentation for the function "The contents of ancillary buffers are always
|
||||
undefined after calling eglSwapBuffers".
|
||||
Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED
|
||||
is not possible for SDL as it requires EGL 1.4, available only on the API level
|
||||
17+, so the only workaround available on this platform is to redraw the entire
|
||||
screen each frame.
|
||||
|
||||
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
|
||||
|
||||
================================================================================
|
||||
Known issues
|
||||
================================================================================
|
||||
|
||||
- The number of buttons reported for each joystick is hardcoded to be 36, which
|
||||
is the current maximum number of buttons Android can report.
|
||||
|
||||
31
Engine/lib/sdl/README-cmake.txt
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
================================================================================
|
||||
CMake build system for SDL (www.cmake.org)
|
||||
================================================================================
|
||||
|
||||
SDL's build system was traditionally based on autotools. Over time, this
|
||||
approach has suffered from several issues across the different supported
|
||||
platforms.
|
||||
To solve these problems, a new build system based on CMake is under development.
|
||||
It works in parallel to the legacy system, so users can experiment with it
|
||||
without complication.
|
||||
While still experimental, the build system should be usable on the following
|
||||
platforms:
|
||||
|
||||
* FreeBSD
|
||||
* Linux
|
||||
* VS.NET 2010
|
||||
* MinGW and Msys
|
||||
* OS X with support for XCode
|
||||
|
||||
================================================================================
|
||||
Usage
|
||||
================================================================================
|
||||
|
||||
Assuming the source for SDL is located at ~/sdl
|
||||
|
||||
cd ~
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../sdl
|
||||
|
||||
This will build the static and dynamic versions of SDL in the ~/build directory.
|
||||
106
Engine/lib/sdl/README-directfb.txt
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
SDL on DirectFB
|
||||
|
||||
Supports:
|
||||
|
||||
- Hardware YUV overlays
|
||||
- OpenGL - software only
|
||||
- 2D/3D accelerations (depends on directfb driver)
|
||||
- multiple displays
|
||||
- windows
|
||||
|
||||
What you need:
|
||||
|
||||
DirectFB 1.0.1, 1.2.x, 1.3.0
|
||||
Kernel-Framebuffer support: required: vesafb, radeonfb ....
|
||||
Mesa 7.0.x - optional for OpenGL
|
||||
|
||||
/etc/directfbrc
|
||||
|
||||
This file should contain the following lines to make
|
||||
your joystick work and avoid crashes:
|
||||
------------------------
|
||||
disable-module=joystick
|
||||
disable-module=cle266
|
||||
disable-module=cyber5k
|
||||
no-linux-input-grab
|
||||
------------------------
|
||||
|
||||
To disable to use x11 backend when DISPLAY variable is found use
|
||||
|
||||
export SDL_DIRECTFB_X11_CHECK=0
|
||||
|
||||
To disable the use of linux input devices, i.e. multimice/multikeyboard support,
|
||||
use
|
||||
|
||||
export SDL_DIRECTFB_LINUX_INPUT=0
|
||||
|
||||
To use hardware accelerated YUV-overlays for YUV-textures, use:
|
||||
|
||||
export SDL_DIRECTFB_YUV_DIRECT=1
|
||||
|
||||
This is disabled by default. It will only support one
|
||||
YUV texture, namely the first. Every other YUV texture will be
|
||||
rendered in software.
|
||||
|
||||
In addition, you may use (directfb-1.2.x)
|
||||
|
||||
export SDL_DIRECTFB_YUV_UNDERLAY=1
|
||||
|
||||
to make the YUV texture an underlay. This will make the cursor to
|
||||
be shown.
|
||||
|
||||
Simple Window Manager
|
||||
=====================
|
||||
|
||||
The driver has support for a very, very basic window manager you may
|
||||
want to use when running with "wm=default". Use
|
||||
|
||||
export SDL_DIRECTFB_WM=1
|
||||
|
||||
to enable basic window borders. In order to have the window title rendered,
|
||||
you need to have the following font installed:
|
||||
|
||||
/usr/share/fonts/truetype/freefont/FreeSans.ttf
|
||||
|
||||
OpenGL Support
|
||||
==============
|
||||
|
||||
The following instructions will give you *software* OpenGL. However this
|
||||
works at least on all directfb supported platforms.
|
||||
|
||||
As of this writing 20100802 you need to pull Mesa from git and do the following:
|
||||
|
||||
------------------------
|
||||
git clone git://anongit.freedesktop.org/git/mesa/mesa
|
||||
cd mesa
|
||||
git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
|
||||
------------------------
|
||||
|
||||
Edit configs/linux-directfb so that the Directories-section looks like
|
||||
------------------------
|
||||
# Directories
|
||||
SRC_DIRS = mesa glu
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = directfb
|
||||
PROGRAM_DIRS =
|
||||
------------------------
|
||||
|
||||
make linux-directfb
|
||||
make
|
||||
|
||||
echo Installing - please enter sudo pw.
|
||||
|
||||
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
||||
cd src/mesa/drivers/directfb
|
||||
make
|
||||
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
||||
------------------------
|
||||
|
||||
To run the SDL - testprograms:
|
||||
|
||||
export SDL_VIDEODRIVER=directfb
|
||||
export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
|
||||
export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
|
||||
|
||||
./testgl
|
||||
|
||||
130
Engine/lib/sdl/README-dynapi.txt
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
================================================================================
|
||||
Dynamic API
|
||||
================================================================================
|
||||
Originally posted by Ryan at https://plus.google.com/103391075724026391227/posts/TB8UfnDYu4U
|
||||
|
||||
Background:
|
||||
|
||||
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2,
|
||||
but developers are shipping their own SDL2 with individual Steam games.
|
||||
These games might stop getting updates, but a newer SDL2 might be needed later.
|
||||
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
|
||||
ever needed, and these fixes won't make it to a game shipping its own SDL.
|
||||
- Even if we replace the SDL2 in those games with a compatible one, that is to
|
||||
say, edit a developer's Steam depot (yuck!), there are developers that are
|
||||
statically linking SDL2 that we can't do this for. We can't even force the
|
||||
dynamic loader to ignore their SDL2 in this case, of course.
|
||||
- If you don't ship an SDL2 with the game in some form, people that disabled the
|
||||
Steam Runtime, or just tried to run the game from the command line instead of
|
||||
Steam might find themselves unable to run the game, due to a missing dependency.
|
||||
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
|
||||
generic Linux boxes that may or may not have SDL2 installed, you have to ship
|
||||
the library or risk a total failure to launch. So now, you might have to have
|
||||
a non-Steam build plus a Steam build (that is, one with and one without SDL2
|
||||
included), which is inconvenient if you could have had one universal build
|
||||
that works everywhere.
|
||||
- We like the zlib license, but the biggest complaint from the open source
|
||||
community about the license change is the static linking. The LGPL forced this
|
||||
as a legal, not technical issue, but zlib doesn't care. Even those that aren't
|
||||
concerned about the GNU freedoms found themselves solving the same problems:
|
||||
swapping in a newer SDL to an older game often times can save the day.
|
||||
Static linking stops this dead.
|
||||
|
||||
So here's what we did:
|
||||
|
||||
SDL now has, internally, a table of function pointers. So, this is what SDL_Init
|
||||
now looks like:
|
||||
|
||||
UInt32 SDL_Init(Uint32 flags)
|
||||
{
|
||||
return jump_table.SDL_Init(flags);
|
||||
}
|
||||
|
||||
Except that is all done with a bunch of macro magic so we don't have to maintain
|
||||
every one of these.
|
||||
|
||||
What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
|
||||
SDL_Init() that you've been calling all this time. But at startup, it looks more
|
||||
like this:
|
||||
|
||||
Uint32 SDL_Init_DEFAULT(Uint32 flags)
|
||||
{
|
||||
SDL_InitDynamicAPI();
|
||||
return jump_table.SDL_Init(flags);
|
||||
}
|
||||
|
||||
SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function
|
||||
pointers, which means that this _DEFAULT function never gets called again.
|
||||
First call to any SDL function sets the whole thing up.
|
||||
|
||||
So you might be asking, what was the value in that? Isn't this what the operating
|
||||
system's dynamic loader was supposed to do for us? Yes, but now we've got this
|
||||
level of indirection, we can do things like this:
|
||||
|
||||
export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
|
||||
./MyGameThatIsStaticallyLinkedToSDL2
|
||||
|
||||
And now, this game that is staticallly linked to SDL, can still be overridden
|
||||
with a newer, or better, SDL. The statically linked one will only be used as
|
||||
far as calling into the jump table in this case. But in cases where no override
|
||||
is desired, the statically linked version will provide its own jump table,
|
||||
and everyone is happy.
|
||||
|
||||
So now:
|
||||
- Developers can statically link SDL, and users can still replace it.
|
||||
(We'd still rather you ship a shared library, though!)
|
||||
- Developers can ship an SDL with their game, Valve can override it for, say,
|
||||
new features on SteamOS, or distros can override it for their own needs,
|
||||
but it'll also just work in the default case.
|
||||
- Developers can ship the same package to everyone (Humble Bundle, GOG, etc),
|
||||
and it'll do the right thing.
|
||||
- End users (and Valve) can update a game's SDL in almost any case,
|
||||
to keep abandoned games running on newer platforms.
|
||||
- Everyone develops with SDL exactly as they have been doing all along.
|
||||
Same headers, same ABI. Just get the latest version to enable this magic.
|
||||
|
||||
|
||||
A little more about SDL_InitDynamicAPI():
|
||||
|
||||
Internally, InitAPI does some locking to make sure everything waits until a
|
||||
single thread initializes everything (although even SDL_CreateThread() goes
|
||||
through here before spinning a thread, too), and then decides if it should use
|
||||
an external SDL library. If not, it sets up the jump table using the current
|
||||
SDL's function pointers (which might be statically linked into a program, or in
|
||||
a shared library of its own). If so, it loads that library and looks for and
|
||||
calls a single function:
|
||||
|
||||
SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
|
||||
|
||||
That function takes a version number (more on that in a moment), the address of
|
||||
the jump table, and the size, in bytes, of the table.
|
||||
Now, we've got policy here: this table's layout never changes; new stuff gets
|
||||
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
|
||||
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
|
||||
bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
|
||||
if it's smaller, we know we can provide the entire API that the caller needs.
|
||||
|
||||
The version variable is a failsafe switch.
|
||||
Right now it's always 1. This number changes when there are major API changes
|
||||
(so we know if the tablesize might be smaller, or entries in it have changed).
|
||||
Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not
|
||||
inconceivable to have a small dispatch library that only supplies this one
|
||||
function and loads different, otherwise-incompatible SDL libraries and has the
|
||||
right one initialize the jump table based on the version. For something that
|
||||
must generically catch lots of different versions of SDL over time, like the
|
||||
Steam Client, this isn't a bad option.
|
||||
|
||||
Finally, I'm sure some people are reading this and thinking
|
||||
"I don't want that overhead in my project!"
|
||||
To which I would point out that the extra function call through the jump table
|
||||
probably wouldn't even show up in a profile, but lucky you: this can all be
|
||||
disabled. You can build SDL without this if you absolutely must, but we would
|
||||
encourage you not to do that. However, on heavily locked down platforms like
|
||||
iOS, or maybe when debugging, it makes sense to disable it. The way this is
|
||||
designed in SDL, you just have to change one #define, and the entire system
|
||||
vaporizes out, and SDL functions exactly like it always did. Most of it is
|
||||
macro magic, so the system is contained to one C file and a few headers.
|
||||
However, this is on by default and you have to edit a header file to turn it
|
||||
off. Our hopes is that if we make it easy to disable, but not too easy,
|
||||
everyone will ultimately be able to get what they want, but we've gently
|
||||
nudged everyone towards what we think is the best solution.
|
||||
72
Engine/lib/sdl/README-gesture.txt
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
===========================================================================
|
||||
Dollar Gestures
|
||||
===========================================================================
|
||||
SDL Provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
|
||||
|
||||
Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up.
|
||||
|
||||
Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
|
||||
|
||||
Recording:
|
||||
----------
|
||||
To begin recording on a touch device call:
|
||||
SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
|
||||
|
||||
Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
|
||||
A SDL_DOLLARRECORD event is a dgesture with the following fields:
|
||||
|
||||
event.dgesture.touchId - the Id of the touch used to record the gesture.
|
||||
event.dgesture.gestureId - the unique id of the recorded gesture.
|
||||
|
||||
|
||||
Performing:
|
||||
-----------
|
||||
As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
|
||||
|
||||
event.dgesture.touchId - the Id of the touch which performed the gesture.
|
||||
event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke.
|
||||
event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
|
||||
event.dgesture.numFingers - the number of fingers used to draw the stroke.
|
||||
|
||||
Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed).
|
||||
|
||||
|
||||
|
||||
Saving:
|
||||
-------
|
||||
To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
||||
|
||||
To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
||||
|
||||
Both functions return the number of gestures successfully saved.
|
||||
|
||||
|
||||
Loading:
|
||||
--------
|
||||
To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file.
|
||||
|
||||
SDL_LoadDollarTemplates returns the number of templates successfully loaded.
|
||||
|
||||
|
||||
|
||||
===========================================================================
|
||||
Multi Gestures
|
||||
===========================================================================
|
||||
SDL provides simple support for pinch/rotate/swipe gestures.
|
||||
Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
|
||||
|
||||
event.mgesture.touchId - the Id of the touch on which the gesture was performed.
|
||||
event.mgesture.x - the normalized x coordinate of the gesture. (0..1)
|
||||
event.mgesture.y - the normalized y coordinate of the gesture. (0..1)
|
||||
event.mgesture.dTheta - the amount that the fingers rotated during this motion.
|
||||
event.mgesture.dDist - the amount that the fingers pinched during this motion.
|
||||
event.mgesture.numFingers - the number of fingers used in the gesture.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Notes
|
||||
===========================================================================
|
||||
For a complete example see test/testgesture.c
|
||||
|
||||
Please direct questions/comments to:
|
||||
jim.tla+sdl_touch@gmail.com
|
||||
23
Engine/lib/sdl/README-hg.txt
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
The latest development version of SDL is available via Mercurial.
|
||||
Mercurial allows you to get up-to-the-minute fixes and enhancements;
|
||||
as a developer works on a source tree, you can use "hg" to mirror that
|
||||
source tree instead of waiting for an official release. Please look
|
||||
at the Mercurial website ( http://mercurial.selenic.com/ ) for more
|
||||
information on using hg, where you can also download software for
|
||||
Mac OS X, Windows, and Unix systems.
|
||||
|
||||
hg clone http://hg.libsdl.org/SDL
|
||||
|
||||
If you are building SDL with an IDE, you will need to copy the file
|
||||
include/SDL_config.h.default to include/SDL_config.h before building.
|
||||
|
||||
If you are building SDL via configure, you will need to run autogen.sh
|
||||
before running configure.
|
||||
|
||||
There is a web interface to the subversion repository at:
|
||||
|
||||
http://hg.libsdl.org/SDL/
|
||||
|
||||
There is an RSS feed available at that URL, for those that want to
|
||||
track commits in real time.
|
||||
|
||||
222
Engine/lib/sdl/README-ios.txt
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
==============================================================================
|
||||
Building the Simple DirectMedia Layer for iPhone OS 2.0
|
||||
==============================================================================
|
||||
|
||||
Requirements: Mac OS X v10.5 or later and the iPhone SDK.
|
||||
|
||||
Instructions:
|
||||
1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in XCode.
|
||||
2. Select your desired target, and hit build.
|
||||
|
||||
There are three build targets:
|
||||
- libSDL.a:
|
||||
Build SDL as a statically linked library
|
||||
- testsdl
|
||||
Build a test program (there are known test failures which are fine)
|
||||
- Template:
|
||||
Package a project template together with the SDL for iPhone static libraries and copies of the SDL headers. The template includes proper references to the SDL library and headers, skeleton code for a basic SDL program, and placeholder graphics for the application icon and startup screen.
|
||||
|
||||
==============================================================================
|
||||
Build SDL for iOS from the command line
|
||||
==============================================================================
|
||||
|
||||
1. cd (PATH WHERE THE SDL CODE IS)/build-scripts
|
||||
2. ./iosbuild.sh
|
||||
|
||||
If everything goes fine, you should see a build/ios directory, inside there's
|
||||
two directories "lib" and "include".
|
||||
"include" contains a copy of the SDL headers that you'll need for your project,
|
||||
make sure to configure XCode to look for headers there.
|
||||
"lib" contains find two files, libSDL2.a and libSDL2main.a, you have to add both
|
||||
to your XCode project. These libraries contain three architectures in them,
|
||||
armv6 for legacy devices, armv7, and i386 (for the simulator).
|
||||
By default, iosbuild.sh will autodetect the SDK version you have installed using
|
||||
xcodebuild -showsdks, and build for iOS >= 3.0, you can override this behaviour
|
||||
by setting the MIN_OS_VERSION variable, ie:
|
||||
|
||||
MIN_OS_VERSION=4.2 ./iosbuild.sh
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer for iOS
|
||||
==============================================================================
|
||||
|
||||
FIXME: This needs to be updated for the latest methods
|
||||
|
||||
Here is the easiest method:
|
||||
1. Build the SDL libraries (libSDL.a and libSDLSimulator.a) and the iPhone SDL Application template.
|
||||
1. Install the iPhone SDL Application template by copying it to one of XCode's template directories. I recommend creating a directory called "SDL" in "/Developer/Platforms/iOS.platform/Developer/Library/XCode/Project Templates/" and placing it there.
|
||||
2. Start a new project using the template. The project should be immediately ready for use with SDL.
|
||||
|
||||
Here is a more manual method:
|
||||
1. Create a new iPhone view based application.
|
||||
2. Build the SDL static libraries (libSDL.a and libSDLSimulator.a) for iPhone and include them in your project. XCode will ignore the library that is not currently of the correct architecture, hence your app will work both on iPhone and in the iPhone Simulator.
|
||||
3. Include the SDL header files in your project.
|
||||
4. Remove the ApplicationDelegate.h and ApplicationDelegate.m files -- SDL for iPhone provides its own UIApplicationDelegate. Remove MainWindow.xib -- SDL for iPhone produces its user interface programmatically.
|
||||
5. Delete the contents of main.m and program your app as a regular SDL program instead. You may replace main.m with your own main.c, but you must tell XCode not to use the project prefix file, as it includes Objective-C code.
|
||||
|
||||
==============================================================================
|
||||
Notes -- Application events
|
||||
==============================================================================
|
||||
|
||||
On iOS the application goes through a fixed life cycle and you will get
|
||||
notifications of state changes via application events. When these events
|
||||
are delivered you must handle them in an event callback because the OS may
|
||||
not give you any processing time after the events are delivered.
|
||||
|
||||
e.g.
|
||||
|
||||
int HandleAppEvents(void *userdata, SDL_Event *event)
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case SDL_APP_TERMINATING:
|
||||
/* Terminate the app.
|
||||
Shut everything down before returning from this function.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_LOWMEMORY:
|
||||
/* You will get this when your app is paused and iOS wants more memory.
|
||||
Release as much memory as possible.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_WILLENTERBACKGROUND:
|
||||
/* Prepare your app to go into the background. Stop loops, etc.
|
||||
This gets called when the user hits the home button, or gets a call.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_DIDENTERBACKGROUND:
|
||||
/* This will get called if the user accepted whatever sent your app to the background.
|
||||
If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops.
|
||||
When you get this, you have 5 seconds to save all your state or the app will be terminated.
|
||||
Your app is NOT active at this point.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_WILLENTERFOREGROUND:
|
||||
/* This call happens when your app is coming back to the foreground.
|
||||
Restore all your state here.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_DIDENTERFOREGROUND:
|
||||
/* Restart your loops here.
|
||||
Your app is interactive and getting CPU again.
|
||||
*/
|
||||
return 0;
|
||||
default:
|
||||
/* No special processing, add it to the event queue */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_SetEventFilter(HandleAppEvents, NULL);
|
||||
|
||||
... run your main loop
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
==============================================================================
|
||||
Notes -- Accelerometer as Joystick
|
||||
==============================================================================
|
||||
|
||||
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
||||
|
||||
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
||||
|
||||
==============================================================================
|
||||
Notes -- OpenGL ES
|
||||
==============================================================================
|
||||
|
||||
Your SDL application for iPhone uses OpenGL ES for video by default.
|
||||
|
||||
OpenGL ES for iPhone supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute.
|
||||
|
||||
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
|
||||
|
||||
Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 1.
|
||||
|
||||
==============================================================================
|
||||
Notes -- Keyboard
|
||||
==============================================================================
|
||||
|
||||
The SDL keyboard API has been extended to support on-screen keyboards:
|
||||
|
||||
void SDL_StartTextInput()
|
||||
-- enables text events and reveals the onscreen keyboard.
|
||||
void SDL_StopTextInput()
|
||||
-- disables text events and hides the onscreen keyboard.
|
||||
SDL_bool SDL_IsTextInputActive()
|
||||
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
|
||||
|
||||
==============================================================================
|
||||
Notes -- Reading and Writing files
|
||||
==============================================================================
|
||||
|
||||
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
|
||||
|
||||
Once your application is installed its directory tree looks like:
|
||||
|
||||
MySDLApp Home/
|
||||
MySDLApp.app
|
||||
Documents/
|
||||
Library/
|
||||
Preferences/
|
||||
tmp/
|
||||
|
||||
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
|
||||
|
||||
More information on this subject is available here:
|
||||
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
|
||||
|
||||
==============================================================================
|
||||
Notes -- iPhone SDL limitations
|
||||
==============================================================================
|
||||
|
||||
Windows:
|
||||
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow the flag SDL_WINDOW_BORDERLESS).
|
||||
|
||||
Textures:
|
||||
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
|
||||
|
||||
Loading Shared Objects:
|
||||
This is disabled by default since it seems to break the terms of the iPhone SDK agreement. It can be re-enabled in SDL_config_iphoneos.h.
|
||||
|
||||
==============================================================================
|
||||
Game Center
|
||||
==============================================================================
|
||||
|
||||
Game Center integration requires that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
|
||||
|
||||
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
|
||||
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
|
||||
|
||||
e.g.
|
||||
|
||||
extern "C"
|
||||
void ShowFrame(void*)
|
||||
{
|
||||
... do event handling, frame logic and rendering
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
... initialize game ...
|
||||
|
||||
#if __IPHONEOS__
|
||||
// Initialize the Game Center for scoring and matchmaking
|
||||
InitGameCenter();
|
||||
|
||||
// Set up the game to run in the window animation callback on iOS
|
||||
// so that Game Center and so forth works correctly.
|
||||
SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
|
||||
#else
|
||||
while ( running ) {
|
||||
ShowFrame(0);
|
||||
DelayFrame();
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
80
Engine/lib/sdl/README-linux.txt
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
================================================================================
|
||||
Simple DirectMedia Layer for Linux
|
||||
================================================================================
|
||||
|
||||
By default SDL will only link against glibc, the rest of the features will be
|
||||
enabled dynamically at runtime depending on the available features on the target
|
||||
system. So, for example if you built SDL with Xinerama support and the target
|
||||
system does not have the Xinerama libraries installed, it will be disabled
|
||||
at runtime, and you won't get a missing library error, at least with the
|
||||
default configuration parameters.
|
||||
|
||||
|
||||
================================================================================
|
||||
Build Dependencies
|
||||
================================================================================
|
||||
|
||||
Ubuntu 13.04, all available features enabled:
|
||||
|
||||
sudo apt-get install build-essential mercurial make cmake autoconf automake \
|
||||
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
|
||||
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
|
||||
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
|
||||
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev
|
||||
|
||||
NOTES:
|
||||
- This includes all the audio targets except arts, because Ubuntu pulled the
|
||||
artsc0-dev package, but in theory SDL still supports it.
|
||||
- DirectFB isn't included because the configure script (currently) fails to find
|
||||
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
|
||||
configure script to include DirectFB support. Send patches. :)
|
||||
|
||||
|
||||
================================================================================
|
||||
Joystick does not work
|
||||
================================================================================
|
||||
|
||||
If you compiled or are using a version of SDL with udev support (and you should!)
|
||||
there's a few issues that may cause SDL to fail to detect your joystick. To
|
||||
debug this, start by installing the evtest utility. On Ubuntu/Debian:
|
||||
|
||||
sudo apt-get install evtest
|
||||
|
||||
Then run:
|
||||
|
||||
sudo evtest
|
||||
|
||||
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
|
||||
Now run:
|
||||
|
||||
cat /dev/input/event/XX
|
||||
|
||||
If you get a permission error, you need to set a udev rule to change the mode of
|
||||
your device (see below)
|
||||
|
||||
Also, try:
|
||||
|
||||
sudo udevadm info --query=all --name=input/eventXX
|
||||
|
||||
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
|
||||
you need to set up an udev rule to force this variable.
|
||||
|
||||
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
|
||||
like:
|
||||
|
||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
|
||||
You can set up similar rules for your device by changing the values listed in
|
||||
idProduct and idVendor. To obtain these values, try:
|
||||
|
||||
sudo udevadm info -a --name=input/eventXX | grep idVendor
|
||||
sudo udevadm info -a --name=input/eventXX | grep idProduct
|
||||
|
||||
If multiple values come up for each of these, the one you want is the first one of each.
|
||||
|
||||
On other systems which ship with an older udev (such as CentOS), you may need
|
||||
to set up a rule such as:
|
||||
|
||||
SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
|
||||
226
Engine/lib/sdl/README-macosx.txt
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with Mac OS X
|
||||
==============================================================================
|
||||
|
||||
These instructions are for people using Apple's Mac OS X (pronounced
|
||||
"ten").
|
||||
|
||||
From the developer's point of view, OS X is a sort of hybrid Mac and
|
||||
Unix system, and you have the option of using either traditional
|
||||
command line tools or Apple's IDE Xcode.
|
||||
|
||||
To build SDL using the command line, use the standard configure and make
|
||||
process:
|
||||
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
You can also build SDL as a Universal library (a single binary for both
|
||||
32-bit and 64-bit Intel architectures), on Mac OS X 10.7 and newer, by using
|
||||
the fatbuild.sh script in build-scripts:
|
||||
sh build-scripts/fatbuild.sh
|
||||
sudo build-scripts/fatbuild.sh install
|
||||
This script builds SDL with 10.5 ABI compatibility on i386 and 10.6
|
||||
ABI compatibility on x86_64 architectures. For best compatibility you
|
||||
should compile your application the same way. A script which wraps
|
||||
gcc to make this easy is provided in test/gcc-fat.sh
|
||||
|
||||
Please note that building SDL requires at least Xcode 4.6 and the 10.7 SDK
|
||||
(even if you target back to 10.5 systems). PowerPC support for Mac OS X has
|
||||
been officially dropped as of SDL 2.0.2.
|
||||
|
||||
To use the library once it's built, you essential have two possibilities:
|
||||
use the traditional autoconf/automake/make method, or use Xcode.
|
||||
|
||||
==============================================================================
|
||||
Caveats for using SDL with Mac OS X
|
||||
==============================================================================
|
||||
|
||||
Some things you have to be aware of when using SDL on Mac OS X:
|
||||
|
||||
- If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
|
||||
SDL will not register its own. This means that SDL will not terminate using
|
||||
SDL_Quit if it receives a termination request, it will terminate like a
|
||||
normal app, and it will not send a SDL_DROPFILE when you request to open a
|
||||
file with the app. To solve these issues, put the following code in your
|
||||
NSApplicationDelegate implementation:
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||
{
|
||||
if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||
{
|
||||
if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_DROPFILE;
|
||||
event.drop.file = SDL_strdup([filename UTF8String]);
|
||||
return (SDL_PushEvent(&event) > 0);
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with a traditional Makefile
|
||||
==============================================================================
|
||||
|
||||
An existing autoconf/automake build system for your SDL app has good chances
|
||||
to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary
|
||||
that you can distribute to users, you need to put the generated binary into a
|
||||
so called "bundle", which basically is a fancy folder with a name like
|
||||
"MyCoolGame.app".
|
||||
|
||||
To get this build automatically, add something like the following rule to
|
||||
your Makefile.am:
|
||||
|
||||
bundle_contents = APP_NAME.app/Contents
|
||||
APP_NAME_bundle: EXE_NAME
|
||||
mkdir -p $(bundle_contents)/MacOS
|
||||
mkdir -p $(bundle_contents)/Resources
|
||||
echo "APPL????" > $(bundle_contents)/PkgInfo
|
||||
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
|
||||
|
||||
You should replace EXE_NAME with the name of the executable. APP_NAME is what
|
||||
will be visible to the user in the Finder. Usually it will be the same
|
||||
as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
|
||||
usually is "TestGame". You might also want to use @PACKAGE@ to use the package
|
||||
name as specified in your configure.in file.
|
||||
|
||||
If your project builds more than one application, you will have to do a bit
|
||||
more. For each of your target applications, you need a separate rule.
|
||||
|
||||
If you want the created bundles to be installed, you may want to add this
|
||||
rule to your Makefile.am:
|
||||
|
||||
install-exec-hook: APP_NAME_bundle
|
||||
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
||||
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
||||
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
||||
|
||||
This rule takes the Bundle created by the rule from step 3 and installs them
|
||||
into $(DESTDIR)$(prefix)/Applications/.
|
||||
|
||||
Again, if you want to install multiple applications, you will have to augment
|
||||
the make rule accordingly.
|
||||
|
||||
|
||||
But beware! That is only part of the story! With the above, you end up with
|
||||
a bare bone .app bundle, which is double clickable from the Finder. But
|
||||
there are some more things you should do before shipping your product...
|
||||
|
||||
1) The bundle right now probably is dynamically linked against SDL. That
|
||||
means that when you copy it to another computer, *it will not run*,
|
||||
unless you also install SDL on that other computer. A good solution
|
||||
for this dilemma is to static link against SDL. On OS X, you can
|
||||
achieve that by linking against the libraries listed by
|
||||
sdl-config --static-libs
|
||||
instead of those listed by
|
||||
sdl-config --libs
|
||||
Depending on how exactly SDL is integrated into your build systems, the
|
||||
way to achieve that varies, so I won't describe it here in detail
|
||||
2) Add an 'Info.plist' to your application. That is a special XML file which
|
||||
contains some meta-information about your application (like some copyright
|
||||
information, the version of your app, the name of an optional icon file,
|
||||
and other things). Part of that information is displayed by the Finder
|
||||
when you click on the .app, or if you look at the "Get Info" window.
|
||||
More information about Info.plist files can be found on Apple's homepage.
|
||||
|
||||
|
||||
As a final remark, let me add that I use some of the techniques (and some
|
||||
variations of them) in Exult and ScummVM; both are available in source on
|
||||
the net, so feel free to take a peek at them for inspiration!
|
||||
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with Xcode
|
||||
==============================================================================
|
||||
|
||||
These instructions are for using Apple's Xcode IDE to build SDL applications.
|
||||
|
||||
- First steps
|
||||
|
||||
The first thing to do is to unpack the Xcode.tar.gz archive in the
|
||||
top level SDL directory (where the Xcode.tar.gz archive resides).
|
||||
Because Stuffit Expander will unpack the archive into a subdirectory,
|
||||
you should unpack the archive manually from the command line:
|
||||
cd [path_to_SDL_source]
|
||||
tar zxf Xcode.tar.gz
|
||||
This will create a new folder called Xcode, which you can browse
|
||||
normally from the Finder.
|
||||
|
||||
- Building the Framework
|
||||
|
||||
The SDL Library is packaged as a framework bundle, an organized
|
||||
relocatable folder hierarchy of executable code, interface headers,
|
||||
and additional resources. For practical purposes, you can think of a
|
||||
framework as a more user and system-friendly shared library, whose library
|
||||
file behaves more or less like a standard UNIX shared library.
|
||||
|
||||
To build the framework, simply open the framework project and build it.
|
||||
By default, the framework bundle "SDL.framework" is installed in
|
||||
/Library/Frameworks. Therefore, the testers and project stationary expect
|
||||
it to be located there. However, it will function the same in any of the
|
||||
following locations:
|
||||
|
||||
~/Library/Frameworks
|
||||
/Local/Library/Frameworks
|
||||
/System/Library/Frameworks
|
||||
|
||||
- Build Options
|
||||
There are two "Build Styles" (See the "Targets" tab) for SDL.
|
||||
"Deployment" should be used if you aren't tweaking the SDL library.
|
||||
"Development" should be used to debug SDL apps or the library itself.
|
||||
|
||||
- Building the Testers
|
||||
Open the SDLTest project and build away!
|
||||
|
||||
- Using the Project Stationary
|
||||
Copy the stationary to the indicated folders to access it from
|
||||
the "New Project" and "Add target" menus. What could be easier?
|
||||
|
||||
- Setting up a new project by hand
|
||||
Some of you won't want to use the Stationary so I'll give some tips:
|
||||
* Create a new "Cocoa Application"
|
||||
* Add src/main/macosx/SDLMain.m , .h and .nib to your project
|
||||
* Remove "main.c" from your project
|
||||
* Remove "MainMenu.nib" from your project
|
||||
* Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
|
||||
* Add "$(HOME)/Library/Frameworks" to the frameworks search path
|
||||
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
|
||||
* Set the "Main Nib File" under "Application Settings" to "SDLMain.nib"
|
||||
* Add your files
|
||||
* Clean and build
|
||||
|
||||
- Building from command line
|
||||
Use pbxbuild in the same directory as your .pbproj file
|
||||
|
||||
- Running your app
|
||||
You can send command line args to your app by either invoking it from
|
||||
the command line (in *.app/Contents/MacOS) or by entering them in the
|
||||
"Executables" panel of the target settings.
|
||||
|
||||
- Implementation Notes
|
||||
Some things that may be of interest about how it all works...
|
||||
* Working directory
|
||||
As defined in the SDL_main.m file, the working directory of your SDL app
|
||||
is by default set to its parent. You may wish to change this to better
|
||||
suit your needs.
|
||||
* You have a Cocoa App!
|
||||
Your SDL app is essentially a Cocoa application. When your app
|
||||
starts up and the libraries finish loading, a Cocoa procedure is called,
|
||||
which sets up the working directory and calls your main() method.
|
||||
You are free to modify your Cocoa app with generally no consequence
|
||||
to SDL. You cannot, however, easily change the SDL window itself.
|
||||
Functionality may be added in the future to help this.
|
||||
|
||||
|
||||
Known bugs are listed in the file "BUGS"
|
||||
16
Engine/lib/sdl/README-pandora.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
SDL 2.0 with open pandora console support ( http://openpandora.org/ )
|
||||
=====================================================================
|
||||
|
||||
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
|
||||
support to work on the pandora under the framebuffer. This driver do not have
|
||||
input support for now, so if you use it you will have to add your own control code.
|
||||
The video driver name is "pandora" so if you have problem running it from
|
||||
the framebuffer, try to set the following variable before starting your application :
|
||||
"export SDL_VIDEODRIVER=pandora"
|
||||
|
||||
- OpenGL ES support was added to the x11 driver, so it's working like the normal
|
||||
x11 driver one with OpenGLX support, with SDL input event's etc..
|
||||
|
||||
|
||||
David Carré (Cpasjuste)
|
||||
cpasjuste@gmail.com
|
||||
30
Engine/lib/sdl/README-platforms.txt
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
This is a list of the platforms SDL supports, and who maintains them.
|
||||
|
||||
Officially supported platforms
|
||||
==============================
|
||||
(code compiles, and thoroughly tested for release)
|
||||
==============================
|
||||
Windows XP/Vista/7/8
|
||||
Mac OS X 10.5+
|
||||
Linux 2.6+
|
||||
iOS 5.1.1+
|
||||
Android 2.3.3+
|
||||
|
||||
Unofficially supported platforms
|
||||
================================
|
||||
(code compiles, but not thoroughly tested)
|
||||
================================
|
||||
FreeBSD
|
||||
NetBSD
|
||||
OpenBSD
|
||||
Solaris
|
||||
|
||||
Platforms supported by volunteers
|
||||
=================================
|
||||
Haiku - maintained by Axel Dörfler <axeld@pinc-software.de>
|
||||
PSP - maintained by 527721088@qq.com
|
||||
Pandora - maintained by Scott Smith <pickle136@sbcglobal.net>
|
||||
|
||||
Platforms that need maintainers
|
||||
===============================
|
||||
61
Engine/lib/sdl/README-porting.txt
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
|
||||
* Porting To A New Platform
|
||||
|
||||
The first thing you have to do when porting to a new platform, is look at
|
||||
include/SDL_platform.h and create an entry there for your operating system.
|
||||
The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
|
||||
Ideally SDL_platform.h will be able to auto-detect the system it's building
|
||||
on based on C preprocessor symbols.
|
||||
|
||||
There are two basic ways of building SDL at the moment:
|
||||
|
||||
1. The "UNIX" way: ./configure; make; make install
|
||||
|
||||
If you have a GNUish system, then you might try this. Edit configure.in,
|
||||
take a look at the large section labelled:
|
||||
"Set up the configuration based on the target platform!"
|
||||
Add a section for your platform, and then re-run autogen.sh and build!
|
||||
|
||||
2. Using an IDE:
|
||||
|
||||
If you're using an IDE or other non-configure build system, you'll probably
|
||||
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
|
||||
add a section for your platform, and create a custom SDL_config_{platform}.h,
|
||||
based on SDL_config.h.minimal and SDL_config.h.in
|
||||
|
||||
Add the top level include directory to the header search path, and then add
|
||||
the following sources to the project:
|
||||
src/*.c
|
||||
src/atomic/*.c
|
||||
src/audio/*.c
|
||||
src/cpuinfo/*.c
|
||||
src/events/*.c
|
||||
src/file/*.c
|
||||
src/haptic/*.c
|
||||
src/joystick/*.c
|
||||
src/power/*.c
|
||||
src/render/*.c
|
||||
src/stdlib/*.c
|
||||
src/thread/*.c
|
||||
src/timer/*.c
|
||||
src/video/*.c
|
||||
src/audio/disk/*.c
|
||||
src/audio/dummy/*.c
|
||||
src/video/dummy/*.c
|
||||
src/haptic/dummy/*.c
|
||||
src/joystick/dummy/*.c
|
||||
src/main/dummy/*.c
|
||||
src/thread/generic/*.c
|
||||
src/timer/dummy/*.c
|
||||
src/loadso/dummy/*.c
|
||||
|
||||
|
||||
Once you have a working library without any drivers, you can go back to each
|
||||
of the major subsystems and start implementing drivers for your platform.
|
||||
|
||||
If you have any questions, don't hesitate to ask on the SDL mailing list:
|
||||
http://www.libsdl.org/mailing-list.php
|
||||
|
||||
Enjoy!
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
|
||||
17
Engine/lib/sdl/README-psp.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
SDL port for the Sony PSP contributed by
|
||||
Captian Lex
|
||||
|
||||
Credit to
|
||||
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
|
||||
Geecko for his PSP GU lib "Glib2d"
|
||||
|
||||
Building
|
||||
--------
|
||||
To build for the PSP, make sure psp-config is in the path and run:
|
||||
make -f Makefile.psp
|
||||
|
||||
|
||||
|
||||
To Do
|
||||
------
|
||||
PSP Screen Keyboard
|
||||
161
Engine/lib/sdl/README-raspberrypi.txt
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
================================================================================
|
||||
SDL2 for Raspberry Pi
|
||||
================================================================================
|
||||
|
||||
Requirements:
|
||||
|
||||
Raspbian (other Linux distros may work as well).
|
||||
|
||||
================================================================================
|
||||
Features
|
||||
================================================================================
|
||||
|
||||
* Works without X11
|
||||
* Hardware accelerated OpenGL ES 2.x
|
||||
* Sound via ALSA
|
||||
* Input (mouse/keyboard/joystick) via EVDEV
|
||||
* Hotplugging of input devices via UDEV
|
||||
|
||||
================================================================================
|
||||
Raspbian Build Dependencies
|
||||
================================================================================
|
||||
|
||||
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
|
||||
|
||||
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
|
||||
OpenGL ES 2.x, it usually comes pre installed, but in any case:
|
||||
|
||||
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
|
||||
|
||||
================================================================================
|
||||
Cross compiling from x86 Linux
|
||||
================================================================================
|
||||
|
||||
To cross compile SDL for Raspbian from your desktop machine, you'll need a
|
||||
Raspbian system root and the cross compilation tools. We'll assume these tools
|
||||
will be placed in /opt/rpi-tools
|
||||
|
||||
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
|
||||
|
||||
You'll also need a Rasbian binary image.
|
||||
Get it from: http://downloads.raspberrypi.org/raspbian_latest
|
||||
After unzipping, you'll get file with a name like: <date>-wheezy-raspbian.img
|
||||
Let's assume the sysroot will be built in /opt/rpi-sysroot.
|
||||
|
||||
export SYSROOT=/opt/rpi-sysroot
|
||||
sudo kpartx -a -v <path_to_raspbian_image>.img
|
||||
sudo mount -o loop /dev/mapper/loop0p2 /mnt
|
||||
sudo cp -r /mnt $SYSROOT
|
||||
sudo apt-get install qemu binfmt-support qemu-user-static
|
||||
sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin
|
||||
sudo mount --bind /dev $SYSROOT/dev
|
||||
sudo mount --bind /proc $SYSROOT/proc
|
||||
sudo mount --bind /sys $SYSROOT/sys
|
||||
|
||||
Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
|
||||
edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
|
||||
|
||||
sudo chroot $SYSROOT
|
||||
apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev
|
||||
exit
|
||||
sudo umount $SYSROOT/dev
|
||||
sudo umount $SYSROOT/proc
|
||||
sudo umount $SYSROOT/sys
|
||||
sudo umount /mnt
|
||||
|
||||
There's one more fix required, as the libdl.so symlink uses an absolute path
|
||||
which doesn't quite work in our setup.
|
||||
|
||||
sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
||||
sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
||||
|
||||
The final step is compiling SDL itself.
|
||||
|
||||
export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
|
||||
cd <SDL SOURCE>
|
||||
mkdir -p build;cd build
|
||||
../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
|
||||
make
|
||||
make install
|
||||
|
||||
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
|
||||
|
||||
perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
|
||||
|
||||
================================================================================
|
||||
Apps don't work or poor video/audio performance
|
||||
================================================================================
|
||||
|
||||
If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to
|
||||
update the RPi's firmware. Note that doing so will fix these problems, but it
|
||||
will also render the CMA - Dynamic Memory Split functionality useless.
|
||||
|
||||
Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too
|
||||
low in general, specially if a 1080p TV is hooked up.
|
||||
|
||||
See here how to configure this setting: http://elinux.org/RPiconfig
|
||||
|
||||
Using a fixed gpu_mem=128 is the best option (specially if you updated the
|
||||
firmware, using CMA probably won't work, at least it's the current case).
|
||||
|
||||
================================================================================
|
||||
No input
|
||||
================================================================================
|
||||
|
||||
Make sure you belong to the "input" group.
|
||||
|
||||
sudo usermod -aG input `whoami`
|
||||
|
||||
================================================================================
|
||||
No HDMI Audio
|
||||
================================================================================
|
||||
|
||||
If you notice that ALSA works but there's no audio over HDMI, try adding:
|
||||
|
||||
hdmi_drive=2
|
||||
|
||||
to your config.txt file and reboot.
|
||||
|
||||
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
|
||||
|
||||
================================================================================
|
||||
Text Input API support
|
||||
================================================================================
|
||||
|
||||
The Text Input API is supported, with translation of scan codes done via the
|
||||
kernel symbol tables. For this to work, SDL needs access to a valid console.
|
||||
If you notice there's no SDL_TEXTINPUT message being emitted, double check that
|
||||
your app has read access to one of the following:
|
||||
|
||||
* /proc/self/fd/0
|
||||
* /dev/tty
|
||||
* /dev/tty[0...6]
|
||||
* /dev/vc/0
|
||||
* /dev/console
|
||||
|
||||
This is usually not a problem if you run from the physical terminal (as opposed
|
||||
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
|
||||
quick workaround is to run your app as root or add yourself to the tty group,
|
||||
then re login to the system.
|
||||
|
||||
sudo usermod -aG tty `whoami`
|
||||
|
||||
The keyboard layout used by SDL is the same as the one the kernel uses.
|
||||
To configure the layout on Raspbian:
|
||||
|
||||
sudo dpkg-reconfigure keyboard-configuration
|
||||
|
||||
To configure the locale, which controls which keys are interpreted as letters,
|
||||
this determining the CAPS LOCK behavior:
|
||||
|
||||
sudo dpkg-reconfigure locales
|
||||
|
||||
================================================================================
|
||||
Notes
|
||||
================================================================================
|
||||
|
||||
* When launching apps remotely (via SSH), SDL can prevent local keystrokes from
|
||||
leaking into the console only if it has root privileges. Launching apps locally
|
||||
does not suffer from this issue.
|
||||
|
||||
|
||||
84
Engine/lib/sdl/README-touch.txt
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
===========================================================================
|
||||
System Specific Notes
|
||||
===========================================================================
|
||||
Linux:
|
||||
The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
|
||||
|
||||
Mac:
|
||||
The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
|
||||
|
||||
iPhone:
|
||||
Works out of box.
|
||||
|
||||
Windows:
|
||||
Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
|
||||
|
||||
===========================================================================
|
||||
Events
|
||||
===========================================================================
|
||||
SDL_FINGERDOWN:
|
||||
Sent when a finger (or stylus) is placed on a touch device.
|
||||
Fields:
|
||||
event.tfinger.touchId - the Id of the touch device.
|
||||
event.tfinger.fingerId - the Id of the finger which just went down.
|
||||
event.tfinger.x - the x coordinate of the touch (0..1)
|
||||
event.tfinger.y - the y coordinate of the touch (0..1)
|
||||
event.tfinger.pressure - the pressure of the touch (0..1)
|
||||
|
||||
SDL_FINGERMOTION:
|
||||
Sent when a finger (or stylus) is moved on the touch device.
|
||||
Fields:
|
||||
Same as SDL_FINGERDOWN but with additional:
|
||||
event.tfinger.dx - change in x coordinate during this motion event.
|
||||
event.tfinger.dy - change in y coordinate during this motion event.
|
||||
|
||||
SDL_FINGERUP:
|
||||
Sent when a finger (or stylus) is lifted from the touch device.
|
||||
Fields:
|
||||
Same as SDL_FINGERDOWN.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Functions
|
||||
===========================================================================
|
||||
SDL provides the ability to access the underlying Finger structures.
|
||||
These structures should _never_ be modified.
|
||||
|
||||
The following functions are included from SDL_touch.h
|
||||
|
||||
To get a SDL_TouchID call SDL_GetTouchDevice(index).
|
||||
This returns a SDL_TouchID.
|
||||
IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouchID will return 0. Be sure to check for this!
|
||||
|
||||
The number of touch devices can be queried with SDL_GetNumTouchDevices().
|
||||
|
||||
A SDL_TouchID may be used to get pointers to SDL_Finger.
|
||||
|
||||
SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device.
|
||||
|
||||
The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following:
|
||||
|
||||
float x = event.tfinger.x;
|
||||
float y = event.tfinger.y;
|
||||
|
||||
|
||||
|
||||
To get a SDL_Finger, call SDL_GetTouchFinger(touchID,index), where touchID is a SDL_TouchID, and index is the requested finger.
|
||||
This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed.
|
||||
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled.
|
||||
As a result, be very careful to check for NULL return values.
|
||||
|
||||
A SDL_Finger has the following fields:
|
||||
>x,y,pressure:
|
||||
The current coordinates of the touch.
|
||||
>pressure:
|
||||
The pressure of the touch.
|
||||
|
||||
===========================================================================
|
||||
Notes
|
||||
===========================================================================
|
||||
For a complete example see test/testgesture.c
|
||||
|
||||
Please direct questions/comments to:
|
||||
jim.tla+sdl_touch@gmail.com
|
||||
(original author, API was changed since)
|
||||
8
Engine/lib/sdl/README-wince.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
Windows CE is no longer supported by SDL.
|
||||
|
||||
We have left the CE support in SDL 1.2 for those that must have it, and we
|
||||
have support for Windows Phone 8 and WinRT in SDL2, as of SDL 2.0.3.
|
||||
|
||||
--ryan.
|
||||
|
||||
42
Engine/lib/sdl/README-windows.txt
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
================================================================================
|
||||
Simple DirectMedia Layer for Windows
|
||||
================================================================================
|
||||
|
||||
================================================================================
|
||||
OpenGL ES 2.x support
|
||||
================================================================================
|
||||
|
||||
SDL has support for OpenGL ES 2.x under Windows via two alternative
|
||||
implementations.
|
||||
The most straightforward method consists in running your app in a system with
|
||||
a graphic card paired with a relatively recent (as of November of 2013) driver
|
||||
which supports the WGL_EXT_create_context_es2_profile extension. Vendors known
|
||||
to ship said extension on Windows currently include nVidia and Intel.
|
||||
|
||||
The other method involves using the ANGLE library (https://code.google.com/p/angleproject/)
|
||||
If an OpenGL ES 2.x context is requested and no WGL_EXT_create_context_es2_profile
|
||||
extension is found, SDL will try to load the libEGL.dll library provided by
|
||||
ANGLE.
|
||||
To obtain the ANGLE binaries, you can either compile from source from
|
||||
https://chromium.googlesource.com/angle/angle or copy the relevant binaries from
|
||||
a recent Chrome/Chromium install for Windows. The files you need are:
|
||||
|
||||
* libEGL.dll
|
||||
* libGLESv2.dll
|
||||
* d3dcompiler_46.dll (supports Windows Vista or later, better shader compiler)
|
||||
or...
|
||||
* d3dcompiler_43.dll (supports Windows XP or later)
|
||||
|
||||
If you compile ANGLE from source, you can configure it so it does not need the
|
||||
d3dcompiler_* DLL at all (for details on this, see their documentation).
|
||||
However, by default SDL will try to preload the d3dcompiler_46.dll to
|
||||
comply with ANGLE's requirements. If you wish SDL to preload d3dcompiler_43.dll (to
|
||||
support Windows XP) or to skip this step at all, you can use the
|
||||
SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more details).
|
||||
|
||||
Known Bugs:
|
||||
|
||||
* SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears
|
||||
that there's a bug in the library which prevents the window contents from
|
||||
refreshing if this is set to anything other than the default value.
|
||||
|
||||
42
Engine/lib/sdl/README.txt
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
Simple DirectMedia Layer
|
||||
|
||||
(SDL)
|
||||
|
||||
Version 2.0
|
||||
|
||||
---
|
||||
http://www.libsdl.org/
|
||||
|
||||
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 including Valve's award winning catalog
|
||||
and many Humble Bundle games.
|
||||
|
||||
SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
|
||||
Support for other platforms may be found in the source code.
|
||||
|
||||
SDL is written in C, works natively with C++, and there are bindings
|
||||
available for several other languages, including C# and Python.
|
||||
|
||||
This library is distributed under the zlib license, which can be found
|
||||
in the file "COPYING.txt".
|
||||
|
||||
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
|
||||
|
||||
If you want to report bugs or contribute patches, please submit them to
|
||||
bugzilla:
|
||||
http://bugzilla.libsdl.org/
|
||||
|
||||
Enjoy!
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
|
||||
112
Engine/lib/sdl/SDL2.spec
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
Summary: Simple DirectMedia Layer
|
||||
Name: SDL2
|
||||
Version: 2.0.3
|
||||
Release: 1
|
||||
Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
|
||||
URL: http://www.libsdl.org/
|
||||
License: zlib
|
||||
Group: System Environment/Libraries
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
Prefix: %{_prefix}
|
||||
%ifos linux
|
||||
Provides: libSDL2-2.0.so.0
|
||||
%endif
|
||||
|
||||
%define __defattr %defattr(-,root,root)
|
||||
%define __soext so
|
||||
|
||||
%description
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
%package devel
|
||||
Summary: Libraries, includes and more to develop SDL applications.
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description devel
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
This is the libraries, include files and other resources you can use
|
||||
to develop SDL applications.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%ifos linux
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-directfb
|
||||
%else
|
||||
%configure
|
||||
%endif
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%ifos linux
|
||||
make install prefix=$RPM_BUILD_ROOT%{prefix} \
|
||||
bindir=$RPM_BUILD_ROOT%{_bindir} \
|
||||
libdir=$RPM_BUILD_ROOT%{_libdir} \
|
||||
includedir=$RPM_BUILD_ROOT%{_includedir} \
|
||||
datadir=$RPM_BUILD_ROOT%{_datadir} \
|
||||
mandir=$RPM_BUILD_ROOT%{_mandir}
|
||||
%else
|
||||
%makeinstall
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%{__defattr}
|
||||
%doc README-SDL.txt COPYING.txt CREDITS.txt BUGS.txt
|
||||
%{_libdir}/lib*.%{__soext}.*
|
||||
|
||||
%files devel
|
||||
%{__defattr}
|
||||
%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew
|
||||
%{_bindir}/*-config
|
||||
%{_libdir}/lib*.a
|
||||
%{_libdir}/lib*.la
|
||||
%{_libdir}/lib*.%{__soext}
|
||||
%{_includedir}/*/*.h
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_datadir}/aclocal/*
|
||||
|
||||
%changelog
|
||||
* Sun Jan 22 2012 Sam Lantinga <slouken@libsdl.org>
|
||||
- Updated for SDL 2.0
|
||||
|
||||
* Tue May 16 2006 Sam Lantinga <slouken@libsdl.org>
|
||||
- Removed support for Darwin, due to build problems on ps2linux
|
||||
|
||||
* Mon Jan 03 2004 Anders Bjorklund <afb@algonet.se>
|
||||
- Added support for Darwin, updated spec file
|
||||
|
||||
* Wed Jan 19 2000 Sam Lantinga <slouken@libsdl.org>
|
||||
- Re-integrated spec file into SDL distribution
|
||||
- 'name' and 'version' come from configure
|
||||
- Some of the documentation is devel specific
|
||||
- Removed SMP support from %build - it doesn't work with libtool anyway
|
||||
|
||||
* Tue Jan 18 2000 Hakan Tandogan <hakan@iconsult.com>
|
||||
- Hacked Mandrake sdl spec to build 1.1
|
||||
|
||||
* Sun Dec 19 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Build Release
|
||||
|
||||
* Sat Dec 18 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Add symlink for libSDL-1.0.so.0 required by sdlbomber
|
||||
- Added docs
|
||||
|
||||
* Thu Dec 09 1999 Lenny Cartier <lenny@mandrakesoft.com>
|
||||
- v 1.0.0
|
||||
|
||||
* Mon Nov 1 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
|
||||
- First spec file for Mandrake distribution.
|
||||
|
||||
# end of file
|
||||
112
Engine/lib/sdl/SDL2.spec.in
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
Summary: Simple DirectMedia Layer
|
||||
Name: SDL2
|
||||
Version: @SDL_VERSION@
|
||||
Release: 1
|
||||
Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
|
||||
URL: http://www.libsdl.org/
|
||||
License: zlib
|
||||
Group: System Environment/Libraries
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
Prefix: %{_prefix}
|
||||
%ifos linux
|
||||
Provides: libSDL2-2.0.so.0
|
||||
%endif
|
||||
|
||||
%define __defattr %defattr(-,root,root)
|
||||
%define __soext so
|
||||
|
||||
%description
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
%package devel
|
||||
Summary: Libraries, includes and more to develop SDL applications.
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description devel
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
This is the libraries, include files and other resources you can use
|
||||
to develop SDL applications.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%ifos linux
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-directfb
|
||||
%else
|
||||
%configure
|
||||
%endif
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%ifos linux
|
||||
make install prefix=$RPM_BUILD_ROOT%{prefix} \
|
||||
bindir=$RPM_BUILD_ROOT%{_bindir} \
|
||||
libdir=$RPM_BUILD_ROOT%{_libdir} \
|
||||
includedir=$RPM_BUILD_ROOT%{_includedir} \
|
||||
datadir=$RPM_BUILD_ROOT%{_datadir} \
|
||||
mandir=$RPM_BUILD_ROOT%{_mandir}
|
||||
%else
|
||||
%makeinstall
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%{__defattr}
|
||||
%doc README-SDL.txt COPYING.txt CREDITS.txt BUGS.txt
|
||||
%{_libdir}/lib*.%{__soext}.*
|
||||
|
||||
%files devel
|
||||
%{__defattr}
|
||||
%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew
|
||||
%{_bindir}/*-config
|
||||
%{_libdir}/lib*.a
|
||||
%{_libdir}/lib*.la
|
||||
%{_libdir}/lib*.%{__soext}
|
||||
%{_includedir}/*/*.h
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_datadir}/aclocal/*
|
||||
|
||||
%changelog
|
||||
* Sun Jan 22 2012 Sam Lantinga <slouken@libsdl.org>
|
||||
- Updated for SDL 2.0
|
||||
|
||||
* Tue May 16 2006 Sam Lantinga <slouken@libsdl.org>
|
||||
- Removed support for Darwin, due to build problems on ps2linux
|
||||
|
||||
* Mon Jan 03 2004 Anders Bjorklund <afb@algonet.se>
|
||||
- Added support for Darwin, updated spec file
|
||||
|
||||
* Wed Jan 19 2000 Sam Lantinga <slouken@libsdl.org>
|
||||
- Re-integrated spec file into SDL distribution
|
||||
- 'name' and 'version' come from configure
|
||||
- Some of the documentation is devel specific
|
||||
- Removed SMP support from %build - it doesn't work with libtool anyway
|
||||
|
||||
* Tue Jan 18 2000 Hakan Tandogan <hakan@iconsult.com>
|
||||
- Hacked Mandrake sdl spec to build 1.1
|
||||
|
||||
* Sun Dec 19 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Build Release
|
||||
|
||||
* Sat Dec 18 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Add symlink for libSDL-1.0.so.0 required by sdlbomber
|
||||
- Added docs
|
||||
|
||||
* Thu Dec 09 1999 Lenny Cartier <lenny@mandrakesoft.com>
|
||||
- v 1.0.0
|
||||
|
||||
* Mon Nov 1 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
|
||||
- First spec file for Mandrake distribution.
|
||||
|
||||
# end of file
|
||||
10
Engine/lib/sdl/TODO.txt
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Future work roadmap:
|
||||
* http://wiki.libsdl.org/moin.cgi/Roadmap
|
||||
|
||||
* Check 1.2 revisions:
|
||||
3554 - Need to resolve semantics for locking keys on different platforms
|
||||
4874 - Do we want screen rotation? At what level?
|
||||
4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98
|
||||
4865 - See if this is still needed (mouse coordinate clamping)
|
||||
4866 - See if this is still needed (blocking window repositioning)
|
||||
|
||||
148
Engine/lib/sdl/VisualC.html
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Using SDL with Microsoft Visual C++</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1>
|
||||
Using SDL with Microsoft Visual C++
|
||||
</H1>
|
||||
<H3>
|
||||
by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro </A>and additions by <A HREF="mailto:james@conceptofzero.net">
|
||||
James Turk</A>
|
||||
</H3>
|
||||
<p>
|
||||
You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php"> the SDL Download web site </A>, or you can build SDL yourself.
|
||||
</p>
|
||||
<H3>
|
||||
Building SDL
|
||||
</H3>
|
||||
<P>
|
||||
Go into the VisualC directory and double-click on the Visual Studio solution for your version of Visual Studio, e.g. <CODE>SDL_VS2008.sln</CODE> This should open up the IDE.
|
||||
</P>
|
||||
<P>
|
||||
There are different solution files for the various
|
||||
versions of the IDE. Please use the appropiate version
|
||||
2008, 2010 or 2012; the 2010EE and 2012EE files
|
||||
should be used with the "Express Edition" releases.
|
||||
</P>
|
||||
<P>
|
||||
Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
|
||||
</P>
|
||||
<P>
|
||||
This is done by right clicking on each project in turn (Projects are listed in
|
||||
the Workspace panel in the FileView tab), and selecting "Build".
|
||||
</P>
|
||||
<P>
|
||||
You may get a few warnings, but you should not get any errors. You do have to
|
||||
have at least the DirectX 9 SDK installed, however. The latest
|
||||
version of DirectX can be downloaded from <A HREF="http://www.microsoft.com">Microsoft</A>.
|
||||
</P>
|
||||
<P>
|
||||
Later, we will refer to the following .lib and .dll files that have just been
|
||||
generated:
|
||||
</P>
|
||||
<ul>
|
||||
<li> SDL2.dll</li>
|
||||
<li> SDL2.lib</li>
|
||||
<li> SDL2main.lib</li>
|
||||
</ul>
|
||||
<P>
|
||||
Search for these using the Windows Find (Windows-F) utility inside the VisualC directory.
|
||||
</P>
|
||||
<H3>
|
||||
Creating a Project with SDL
|
||||
</H3>
|
||||
<P>
|
||||
Create a project as a Win32 Application.
|
||||
</P>
|
||||
<P>
|
||||
Create a C++ file for your project.
|
||||
</P>
|
||||
<P>
|
||||
Set the C runtime to "Multi-threaded DLL" in the menu: <CODE>Project|Settings|C/C++
|
||||
tab|Code Generation|Runtime Library </CODE>.
|
||||
</P>
|
||||
<P>
|
||||
Add the SDL <CODE>include</CODE> directory to your list of includes in the
|
||||
menu: <CODE>Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>
|
||||
.
|
||||
<br>
|
||||
<STRONG><FONT color="#009900">VC7 Specific: Instead of doing this I find it easier to
|
||||
add the include and library directories to the list that VC7 keeps. Do this by
|
||||
selecting Tools|Options|Projects|VC++ Directories and under the "Show
|
||||
Directories For:" dropbox select "Include Files", and click the "New Directory
|
||||
Icon" and add the [SDLROOT]\include directory (e.g. If you installed to
|
||||
c:\SDL\ add c:\SDL\include). Proceed to change the
|
||||
dropbox selection to "Library Files" and add [SDLROOT]\lib.</FONT></STRONG>
|
||||
</P>
|
||||
<P>
|
||||
The "include directory" I am referring to is the <CODE>include</CODE> folder
|
||||
within the main SDL directory (the one that this HTML file located within).
|
||||
</P>
|
||||
<P>
|
||||
Now we're going to use the files that we had created earlier in the Build SDL
|
||||
step.
|
||||
</P>
|
||||
<P>
|
||||
Copy the following files into your Project directory:
|
||||
</P>
|
||||
<ul>
|
||||
<li> SDL2.dll</li>
|
||||
</ul>
|
||||
<P>
|
||||
Add the following files to your project (It is not necessary to copy them to
|
||||
your project directory):
|
||||
</P>
|
||||
<ul>
|
||||
<li> SDL2.lib </li>
|
||||
<li> SDL2main.lib</li>
|
||||
</ul>
|
||||
<P>
|
||||
(To add them to your project, right click on your project, and select "Add
|
||||
files to project")
|
||||
</P>
|
||||
<P><STRONG><FONT color="#009900">Instead of adding the files to your project it is more
|
||||
desireable to add them to the linker options: Project|Properties|Linker|Command
|
||||
Line and type the names of the libraries to link with in the "Additional
|
||||
Options:" box. Note: This must be done for each build
|
||||
configuration (e.g. Release,Debug).</FONT></STRONG></P>
|
||||
<H3>
|
||||
SDL 101, First Day of Class
|
||||
</H3>
|
||||
<P>
|
||||
Now create the basic body of your project. The body of your program should take
|
||||
the following form: <CODE>
|
||||
<PRE>
|
||||
#include "SDL.h"
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
// Body of the program goes here.
|
||||
return 0;
|
||||
}
|
||||
</PRE>
|
||||
</CODE>
|
||||
<P></P>
|
||||
<H3>
|
||||
That's it!
|
||||
</H3>
|
||||
<P>
|
||||
I hope that this document has helped you get through the most difficult part of
|
||||
using the SDL: installing it. Suggestions for improvements to this document
|
||||
should be sent to the writers of this document.
|
||||
</P>
|
||||
<P>
|
||||
Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port.
|
||||
</P>
|
||||
<P>
|
||||
This document was originally called "VisualC.txt", and was written by <A HREF="mailto:slouken@libsdl.org">
|
||||
Sam Lantinga</A>.
|
||||
</P>
|
||||
<P>
|
||||
Later, it was converted to HTML and expanded into the document that you see
|
||||
today by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro</A>.
|
||||
</P>
|
||||
<P>Minor Fixes and Visual C++ 7 Information (In Green) was added by <A HREF="mailto:james@conceptofzero.net">James Turk</A>
|
||||
</P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
5
Engine/lib/sdl/VisualC/clean.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
find . -type d -name 'Debug' -exec rm -rv {} \;
|
||||
find . -type d -name 'Release' -exec rm -rv {} \;
|
||||
find . -type f -name '*.user' -exec rm -v {} \;
|
||||
find . -type f -name '*.ncb' -exec rm -v {} \;
|
||||
find . -type f -name '*.suo' -exec rm -v {} \;
|
||||
108
Engine/lib/sdl/WhatsNew.txt
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
|
||||
This is a list of major changes in SDL's version history.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.3:
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Mac OS X:
|
||||
* Fixed creating an OpenGL context by default on Mac OS X 10.6
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.2:
|
||||
---------------------------------------------------------------------------
|
||||
General:
|
||||
* Added SDL_GL_ResetAttributes() to reset OpenGL attributes to default values
|
||||
* Added an API to load a database of game controller mappings from a file:
|
||||
SDL_GameControllerAddMappingsFromFile(), SDL_GameControllerAddMappingsFromRW()
|
||||
* Added game controller mappings for the PS4 and OUYA controllers
|
||||
* Added SDL_GetDefaultAssertionHandler() and SDL_GetAssertionHandler()
|
||||
* Added SDL_DetachThread()
|
||||
* Added SDL_HasAVX() to determine if the CPU has AVX features
|
||||
* Added SDL_vsscanf(), SDL_acos(), and SDL_asin() to the stdlib routines
|
||||
* EGL can now create/manage OpenGL and OpenGL ES 1.x/2.x contexts, and share
|
||||
them using SDL_GL_SHARE_WITH_CURRENT_CONTEXT
|
||||
* Added a field "clicks" to the mouse button event which records whether the event is a single click, double click, etc.
|
||||
* The screensaver is now disabled by default, and there is a hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER that can change that behavior.
|
||||
* Added a hint SDL_HINT_MOUSE_RELATIVE_MODE_WARP to specify whether mouse relative mode should be emulated using mouse warping.
|
||||
* testgl2 does not need to link with libGL anymore
|
||||
* Added testgles2 test program to demonstrate working with OpenGL ES 2.0
|
||||
* Added controllermap test program to visually map a game controller
|
||||
|
||||
Windows:
|
||||
* Support for OpenGL ES 2.x contexts using either WGL or EGL (natively via
|
||||
the driver or emulated through ANGLE)
|
||||
* Added a hint SDL_HINT_VIDEO_WIN_D3DCOMPILER to specify which D3D shader compiler to use for OpenGL ES 2 support through ANGLE
|
||||
* Added a hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that is useful when creating multiple windows that should share the same OpenGL context.
|
||||
* Added an event SDL_RENDER_TARGETS_RESET that is sent when D3D9 render targets are reset after the device has been restored.
|
||||
|
||||
Mac OS X:
|
||||
* Added a hint SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK to control whether Ctrl+click should be treated as a right click on Mac OS X. This is off by default.
|
||||
|
||||
Linux:
|
||||
* Fixed fullscreen and focused behavior when receiving NotifyGrab events
|
||||
* Added experimental Wayland and Mir support, disabled by default
|
||||
|
||||
Android:
|
||||
* Joystick support (minimum SDK version required to build SDL is now 12,
|
||||
the required runtime version remains at 10, but on such devices joystick
|
||||
support won't be available).
|
||||
* Hotplugging support for joysticks
|
||||
* Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default.
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.1:
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
General:
|
||||
* Added an API to get common filesystem paths in SDL_filesystem.h:
|
||||
SDL_GetBasePath(), SDL_GetPrefPath()
|
||||
* Added an API to do optimized YV12 and IYUV texture updates:
|
||||
SDL_UpdateYUVTexture()
|
||||
* Added an API to get the amount of RAM on the system:
|
||||
SDL_GetSystemRAM()
|
||||
* Added a macro to perform timestamp comparisons with SDL_GetTicks():
|
||||
SDL_TICKS_PASSED()
|
||||
* Dramatically improved OpenGL ES 2.0 rendering performance
|
||||
* Added OpenGL attribute SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
|
||||
|
||||
Windows:
|
||||
* Created a static library configuration for the Visual Studio 2010 project
|
||||
* Added a hint to create the Direct3D device with support for multi-threading:
|
||||
SDL_HINT_RENDER_DIRECT3D_THREADSAFE
|
||||
* Added a function to get the D3D9 adapter index for a display:
|
||||
SDL_Direct3D9GetAdapterIndex()
|
||||
* Added a function to get the D3D9 device for a D3D9 renderer:
|
||||
SDL_RenderGetD3D9Device()
|
||||
* Fixed building SDL with the mingw32 toolchain (mingw-w64 is preferred)
|
||||
* Fixed crash when using two XInput controllers at the same time
|
||||
* Fixed detecting a mixture of XInput and DirectInput controllers
|
||||
* Fixed clearing a D3D render target larger than the window
|
||||
* Improved support for format specifiers in SDL_snprintf()
|
||||
|
||||
Mac OS X:
|
||||
* Added support for retina displays:
|
||||
Create your window with the SDL_WINDOW_ALLOW_HIGHDPI flag, and then use SDL_GL_GetDrawableSize() to find the actual drawable size. You are responsible for scaling mouse and drawing coordinates appropriately.
|
||||
* Fixed mouse warping in fullscreen mode
|
||||
* Right mouse click is emulated by holding the Ctrl key while left clicking
|
||||
|
||||
Linux:
|
||||
* Fixed float audio support with the PulseAudio driver
|
||||
* Fixed missing line endpoints in the OpenGL renderer on some drivers
|
||||
* X11 symbols are no longer defined to avoid collisions when linking statically
|
||||
|
||||
iOS:
|
||||
* Fixed status bar visibility on iOS 7
|
||||
* Flipped the accelerometer Y axis to match expected values
|
||||
|
||||
Android:
|
||||
IMPORTANT: You MUST get the updated SDLActivity.java to match C code
|
||||
* Moved EGL initialization to native code
|
||||
* Fixed the accelerometer axis rotation relative to the device rotation
|
||||
* Fixed race conditions when handling the EGL context on pause/resume
|
||||
* Touch devices are available for enumeration immediately after init
|
||||
|
||||
Raspberry Pi:
|
||||
* Added support for the Raspberry Pi, see README-raspberrypi.txt for details
|
||||
BIN
Engine/lib/sdl/Xcode-iOS/Demos/Default.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
1019
Engine/lib/sdl/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
Normal file
BIN
Engine/lib/sdl/Xcode-iOS/Demos/Icon.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
30
Engine/lib/sdl/Xcode-iOS/Demos/Info.plist
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string></string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array/>
|
||||
</dict>
|
||||
</plist>
|
||||
43
Engine/lib/sdl/Xcode-iOS/Demos/README
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
==============================================================================
|
||||
About the iPhone OS Demo Applications
|
||||
==============================================================================
|
||||
|
||||
Demos.xcodeproj contains several targets for iPhone oriented SDL demos. These demos are written strictly using SDL 1.3 calls. All the demos except for Fireworks (which requires OpenGL ES) should work on platforms other than iPhone OS, though you'll need to write your own compile script. To run them on your favorite platform, you may wish to set the macros SCREEN_WIDTH and SCREEN_HEIGHT, located in common.h.
|
||||
|
||||
Common files:
|
||||
|
||||
common.c and common.h contain code common to all demo applications. This includes macros about the screen dimensions (in pixels), simple error handling, and functions for generating random numbers.
|
||||
|
||||
Rectangles (rectangles.c):
|
||||
|
||||
Draws randomly sized and colored rectangles all over the screen by using SDL_RenderFill. This is the simplest of all the demos.
|
||||
|
||||
Happy (happy.c):
|
||||
|
||||
Loads the classic happy-face bitmap and draws a large number of happy faces bouncing around the screen. Shows how you can load a bitmap into an SDL_Texture.
|
||||
|
||||
Accelerometer (accelerometer.c):
|
||||
|
||||
Uses the iPhone's accelerometer as a joystick device to move a spaceship around the screen. Note the use of the macro SDL_IPHONE_MAX_GFORCE (normally defined in SDL_config_iphoneos.h) which converts between the Sint16 number returned by SDL_JoystickGetAxis, and the floating point units of g-force reported natively by the iPhone.
|
||||
|
||||
Touch (touch.c):
|
||||
|
||||
Acts as a finger-paint type program. Demonstrates how you can use SDL mouse input to accept touch input from the iPhone. If SDL for iPhone is compiled with multitouch as multiple mouse emulation (SDL_IPHONE_MULTIPLE_MICE in SDL_config_iphoneos.h) then the program will accept multiple finger inputs simultaneously.
|
||||
|
||||
Mixer (mixer.c):
|
||||
|
||||
Displays several rectangular buttons which can be used as a virtual drumkit. Demonstrates how you can play .wav sounds in SDL and how you can use SDL_MixAudioFormat to build a software mixer that can play multiple sounds at once.
|
||||
|
||||
Keyboard (keyboard.c):
|
||||
|
||||
Loads a bitmap font and let's the user type words, numbers, and symbols using the iPhone's virtual keyboard. The iPhone's onscreen keyboard visibility is toggled when the user taps the screen. If the user types ':)' a happy face is displayed. Demonstrates how to use functions added to the iPhone implementation of SDL to toggle keyboard onscreen visibility.
|
||||
|
||||
Fireworks (fireworks.c):
|
||||
|
||||
Displays a fireworks show. When you tap the iPhone's screen, fireworks fly from the bottom of the screen and explode at the point that you tapped. Demonstrates how you can use SDL on iPhone to build an OpenGL ES based application. Shows you how you can use SDL_LoadBMP to load a bmp image and convert it to an OpenGL ES texture. Of lesser importance, shows how you can use OpenGL ES point sprites to build an efficient particle system.
|
||||
|
||||
==============================================================================
|
||||
Building and Running the demos
|
||||
==============================================================================
|
||||
|
||||
Before building the demos you must first build SDL as a static library for BOTH the iPhone Simulator and the iPhone itself. See the iPhone SDL main README file for directions on how to do this. Once this is done, simply launch XCode, select the target you'd like to build, select the active SDK (simulator or device), and then build and go.
|
||||
|
After Width: | Height: | Size: 44 KiB |
258
Engine/lib/sdl/Xcode-iOS/Demos/data/bitmapfont/license.txt
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
__ _ _
|
||||
/ _| | | | |
|
||||
| |_ ___ _ __ | |_ _ __ __ _ ___| | __
|
||||
| _/ _ \| '_ \| __| '_ \ / _` |/ __| |/ /
|
||||
| || (_) | | | | |_| |_) | (_| | (__| <
|
||||
|_| \___/|_| |_|\__| .__/ \__,_|\___|_|\_\
|
||||
| |
|
||||
|_|
|
||||
----------------------------------------------------------------------
|
||||
Product : font-pack.zip
|
||||
Website : http://www.spicypixel.net
|
||||
Author : Marc Russell
|
||||
Released: 16th January 2008
|
||||
----------------------------------------------------------------------
|
||||
|
||||
What is this?
|
||||
-------------
|
||||
font-pack is a package of free art assets to be used under the terms of this document. It is available to game developers and hobbyists alike.
|
||||
|
||||
Contents
|
||||
--------
|
||||
The contents of the font-pack ZIP file include 20 bitmap fonts
|
||||
|
||||
Usage License & Restrictions
|
||||
----------------------------
|
||||
font-pack is distributed under the "Common Public License Version 1.0."
|
||||
The terms of which are given below. If you do not understand the terms of the license please refer to a solicitor. It should however, be relatively clear how this package can be used.
|
||||
|
||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON
|
||||
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
|
||||
THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
"Contribution" means:
|
||||
|
||||
a) in the case of the initial Contributor, the initial code and
|
||||
documentation distributed under this Agreement, and
|
||||
|
||||
b) in the case of each subsequent Contributor:
|
||||
|
||||
i) changes to the Program, and
|
||||
|
||||
ii) additions to the Program;
|
||||
|
||||
where such changes and/or additions to the Program originate from
|
||||
and are distributed by that particular Contributor. A Contribution
|
||||
'originates' from a Contributor if it was added to the Program by
|
||||
such Contributor itself or anyone acting on such Contributor's
|
||||
behalf. Contributions do not include additions to the Program which:
|
||||
(i) are separate modules of software distributed in conjunction with
|
||||
the Program under their own license agreement, and (ii) are not
|
||||
derivative works of the Program.
|
||||
|
||||
"Contributor" means any person or entity that distributes the Program.
|
||||
|
||||
"Licensed Patents " mean patent claims licensable by a Contributor which
|
||||
are necessarily infringed by the use or sale of its Contribution alone
|
||||
or when combined with the Program.
|
||||
|
||||
"Program" means the Contributions distributed in accordance with this
|
||||
Agreement.
|
||||
|
||||
"Recipient" means anyone who receives the Program under this Agreement,
|
||||
including all Contributors.
|
||||
|
||||
2. GRANT OF RIGHTS
|
||||
|
||||
a) Subject to the terms of this Agreement, each Contributor hereby
|
||||
grants Recipient a non-exclusive, worldwide, royalty-free copyright
|
||||
license to reproduce, prepare derivative works of, publicly display,
|
||||
publicly perform, distribute and sublicense the Contribution of such
|
||||
Contributor, if any, and such derivative works, in source code and
|
||||
object code form.
|
||||
|
||||
b) Subject to the terms of this Agreement, each Contributor hereby
|
||||
grants Recipient a non-exclusive, worldwide, royalty-free patent
|
||||
license under Licensed Patents to make, use, sell, offer to sell,
|
||||
import and otherwise transfer the Contribution of such Contributor,
|
||||
if any, in source code and object code form. This patent license
|
||||
shall apply to the combination of the Contribution and the Program
|
||||
if, at the time the Contribution is added by the Contributor, such
|
||||
addition of the Contribution causes such combination to be covered
|
||||
by the Licensed Patents. The patent license shall not apply to any
|
||||
other combinations which include the Contribution. No hardware per
|
||||
se is licensed hereunder.
|
||||
|
||||
c) Recipient understands that although each Contributor grants the
|
||||
licenses to its Contributions set forth herein, no assurances are
|
||||
provided by any Contributor that the Program does not infringe the
|
||||
patent or other intellectual property rights of any other entity.
|
||||
Each Contributor disclaims any liability to Recipient for claims
|
||||
brought by any other entity based on infringement of intellectual
|
||||
property rights or otherwise. As a condition to exercising the
|
||||
rights and licenses granted hereunder, each Recipient hereby assumes
|
||||
sole responsibility to secure any other intellectual property rights
|
||||
needed, if any. For example, if a third party patent license is
|
||||
required to allow Recipient to distribute the Program, it is
|
||||
Recipient's responsibility to acquire that license before
|
||||
distributing the Program.
|
||||
|
||||
d) Each Contributor represents that to its knowledge it has
|
||||
sufficient copyright rights in its Contribution, if any, to grant
|
||||
the copyright license set forth in this Agreement.
|
||||
|
||||
3. REQUIREMENTS
|
||||
|
||||
A Contributor may choose to distribute the Program in object code form
|
||||
under its own license agreement, provided that:
|
||||
|
||||
a) it complies with the terms and conditions of this Agreement; and
|
||||
|
||||
b) its license agreement:
|
||||
|
||||
i) effectively disclaims on behalf of all Contributors all
|
||||
warranties and conditions, express and implied, including warranties
|
||||
or conditions of title and non-infringement, and implied warranties
|
||||
or conditions of merchantability and fitness for a particular
|
||||
purpose;
|
||||
|
||||
ii) effectively excludes on behalf of all Contributors all liability
|
||||
for damages, including direct, indirect, special, incidental and
|
||||
consequential damages, such as lost profits;
|
||||
|
||||
iii) states that any provisions which differ from this Agreement are
|
||||
offered by that Contributor alone and not by any other party; and
|
||||
|
||||
iv) states that source code for the Program is available from such
|
||||
Contributor, and informs licensees how to obtain it in a reasonable
|
||||
manner on or through a medium customarily used for software
|
||||
exchange.
|
||||
|
||||
When the Program is made available in source code form:
|
||||
|
||||
a) it must be made available under this Agreement; and
|
||||
|
||||
b) a copy of this Agreement must be included with each copy of the
|
||||
Program.
|
||||
|
||||
Contributors may not remove or alter any copyright notices contained
|
||||
within the Program.
|
||||
|
||||
Each Contributor must identify itself as the originator of its
|
||||
Contribution, if any, in a manner that reasonably allows subsequent
|
||||
Recipients to identify the originator of the Contribution.
|
||||
|
||||
4. COMMERCIAL DISTRIBUTION
|
||||
|
||||
Commercial distributors of software may accept certain responsibilities
|
||||
with respect to end users, business partners and the like. While this
|
||||
license is intended to facilitate the commercial use of the Program, the
|
||||
Contributor who includes the Program in a commercial product offering
|
||||
should do so in a manner which does not create potential liability for
|
||||
other Contributors. Therefore, if a Contributor includes the Program in
|
||||
a commercial product offering, such Contributor ("Commercial
|
||||
Contributor") hereby agrees to defend and indemnify every other
|
||||
Contributor ("Indemnified Contributor") against any losses, damages and
|
||||
costs (collectively "Losses") arising from claims, lawsuits and other
|
||||
legal actions brought by a third party against the Indemnified
|
||||
Contributor to the extent caused by the acts or omissions of such
|
||||
Commercial Contributor in connection with its distribution of the
|
||||
Program in a commercial product offering. The obligations in this
|
||||
section do not apply to any claims or Losses relating to any actual or
|
||||
alleged intellectual property infringement. In order to qualify, an
|
||||
Indemnified Contributor must: a) promptly notify the Commercial
|
||||
Contributor in writing of such claim, and b) allow the Commercial
|
||||
Contributor to control, and cooperate with the Commercial Contributor
|
||||
in, the defense and any related settlement negotiations. The Indemnified
|
||||
Contributor may participate in any such claim at its own expense.
|
||||
|
||||
For example, a Contributor might include the Program in a commercial
|
||||
product offering, Product X. That Contributor is then a Commercial
|
||||
Contributor. If that Commercial Contributor then makes performance
|
||||
claims, or offers warranties related to Product X, those performance
|
||||
claims and warranties are such Commercial Contributor's responsibility
|
||||
alone. Under this section, the Commercial Contributor would have to
|
||||
defend claims against the other Contributors related to those
|
||||
performance claims and warranties, and if a court requires any other
|
||||
Contributor to pay any damages as a result, the Commercial Contributor
|
||||
must pay those damages.
|
||||
|
||||
5. NO WARRANTY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
|
||||
ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES
|
||||
OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
|
||||
A PARTICULAR PURPOSE. Each Recipient is solely responsible for
|
||||
determining the appropriateness of using and distributing the Program
|
||||
and assumes all risks associated with its exercise of rights under this
|
||||
Agreement, including but not limited to the risks and costs of program
|
||||
errors, compliance with applicable laws, damage to or loss of data,
|
||||
programs or equipment, and unavailability or interruption of operations.
|
||||
|
||||
6. DISCLAIMER OF LIABILITY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
|
||||
ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
|
||||
WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
|
||||
DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
|
||||
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. GENERAL
|
||||
|
||||
If any provision of this Agreement is invalid or unenforceable under
|
||||
applicable law, it shall not affect the validity or enforceability of
|
||||
the remainder of the terms of this Agreement, and without further action
|
||||
by the parties hereto, such provision shall be reformed to the minimum
|
||||
extent necessary to make such provision valid and enforceable.
|
||||
|
||||
If Recipient institutes patent litigation against a Contributor with
|
||||
respect to a patent applicable to software (including a cross-claim or
|
||||
counterclaim in a lawsuit), then any patent licenses granted by that
|
||||
Contributor to such Recipient under this Agreement shall terminate as of
|
||||
the date such litigation is filed. In addition, if Recipient institutes
|
||||
patent litigation against any entity (including a cross-claim or
|
||||
counterclaim in a lawsuit) alleging that the Program itself (excluding
|
||||
combinations of the Program with other software or hardware) infringes
|
||||
such Recipient's patent(s), then such Recipient's rights granted under
|
||||
Section 2(b) shall terminate as of the date such litigation is filed.
|
||||
|
||||
All Recipient's rights under this Agreement shall terminate if it fails
|
||||
to comply with any of the material terms or conditions of this Agreement
|
||||
and does not cure such failure in a reasonable period of time after
|
||||
becoming aware of such noncompliance. If all Recipient's rights under
|
||||
this Agreement terminate, Recipient agrees to cease use and distribution
|
||||
of the Program as soon as reasonably practicable. However, Recipient's
|
||||
obligations under this Agreement and any licenses granted by Recipient
|
||||
relating to the Program shall continue and survive.
|
||||
|
||||
Everyone is permitted to copy and distribute copies of this Agreement,
|
||||
but in order to avoid inconsistency the Agreement is copyrighted and may
|
||||
only be modified in the following manner. The Agreement Steward reserves
|
||||
the right to publish new versions (including revisions) of this
|
||||
Agreement from time to time. No one other than the Agreement Steward has
|
||||
the right to modify this Agreement. IBM is the initial Agreement
|
||||
Steward. IBM may assign the responsibility to serve as the Agreement
|
||||
Steward to a suitable separate entity. Each new version of the Agreement
|
||||
will be given a distinguishing version number. The Program (including
|
||||
Contributions) may always be distributed subject to the version of the
|
||||
Agreement under which it was received. In addition, after a new version
|
||||
of the Agreement is published, Contributor may elect to distribute the
|
||||
Program (including its Contributions) under the new version. Except as
|
||||
expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
|
||||
rights or licenses to the intellectual property of any Contributor under
|
||||
this Agreement, whether expressly, by implication, estoppel or
|
||||
otherwise. All rights in the Program not expressly granted under this
|
||||
Agreement are reserved.
|
||||
|
||||
This Agreement is governed by the laws of the State of New York and the
|
||||
intellectual property laws of the United States of America. No party to
|
||||
this Agreement will bring a legal action under this Agreement more than
|
||||
one year after the cause of action arose. Each party waives its rights
|
||||
to a jury trial in any resulting litigation.
|
||||
|
||||
BIN
Engine/lib/sdl/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav
Normal file
BIN
Engine/lib/sdl/Xcode-iOS/Demos/data/drums/ds_china.wav
Normal file
BIN
Engine/lib/sdl/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav
Normal file
BIN
Engine/lib/sdl/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav
Normal file
BIN
Engine/lib/sdl/Xcode-iOS/Demos/data/icon.bmp
Normal file
|
After Width: | Height: | Size: 578 B |
BIN
Engine/lib/sdl/Xcode-iOS/Demos/data/ship.bmp
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
Engine/lib/sdl/Xcode-iOS/Demos/data/space.bmp
Normal file
|
After Width: | Height: | Size: 450 KiB |
BIN
Engine/lib/sdl/Xcode-iOS/Demos/data/stroke.bmp
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
239
Engine/lib/sdl/Xcode-iOS/Demos/src/accelerometer.c
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
/*
|
||||
* accelerometer.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include "math.h"
|
||||
#include "common.h"
|
||||
|
||||
#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */
|
||||
#define DAMPING 0.5f; /* after bouncing off a wall, damping coefficient determines final speed */
|
||||
#define FRICTION 0.0008f /* coefficient of acceleration that opposes direction of motion */
|
||||
#define GRAVITY_CONSTANT 0.004f /* how sensitive the ship is to the accelerometer */
|
||||
|
||||
/* If we aren't on an iPhone, then this definition ought to yield reasonable behavior */
|
||||
#ifndef SDL_IPHONE_MAX_GFORCE
|
||||
#define SDL_IPHONE_MAX_GFORCE 5.0f
|
||||
#endif
|
||||
|
||||
static SDL_Joystick *accelerometer; /* used for controlling the ship */
|
||||
|
||||
static struct
|
||||
{
|
||||
float x, y; /* position of ship */
|
||||
float vx, vy; /* velocity of ship (in pixels per millesecond) */
|
||||
SDL_Rect rect; /* (drawn) position and size of ship */
|
||||
} shipData;
|
||||
|
||||
static SDL_Texture *ship = 0; /* texture for spaceship */
|
||||
static SDL_Texture *space = 0; /* texture for space (background */
|
||||
|
||||
void
|
||||
render(SDL_Renderer *renderer, int w, int h)
|
||||
{
|
||||
|
||||
|
||||
/* get joystick (accelerometer) axis values and normalize them */
|
||||
float ax = SDL_JoystickGetAxis(accelerometer, 0);
|
||||
float ay = SDL_JoystickGetAxis(accelerometer, 1);
|
||||
|
||||
/* ship screen constraints */
|
||||
Uint32 minx = 0.0f;
|
||||
Uint32 maxx = w - shipData.rect.w;
|
||||
Uint32 miny = 0.0f;
|
||||
Uint32 maxy = h - shipData.rect.h;
|
||||
|
||||
#define SINT16_MAX ((float)(0x7FFF))
|
||||
|
||||
/* update velocity from accelerometer
|
||||
the factor SDL_IPHONE_MAX_G_FORCE / SINT16_MAX converts between
|
||||
SDL's units reported from the joytick, and units of g-force, as reported by the accelerometer
|
||||
*/
|
||||
shipData.vx +=
|
||||
ax * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT *
|
||||
MILLESECONDS_PER_FRAME;
|
||||
shipData.vy +=
|
||||
ay * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT *
|
||||
MILLESECONDS_PER_FRAME;
|
||||
|
||||
float speed = sqrt(shipData.vx * shipData.vx + shipData.vy * shipData.vy);
|
||||
|
||||
if (speed > 0) {
|
||||
/* compensate for friction */
|
||||
float dirx = shipData.vx / speed; /* normalized x velocity */
|
||||
float diry = shipData.vy / speed; /* normalized y velocity */
|
||||
|
||||
/* update velocity due to friction */
|
||||
if (speed - FRICTION * MILLESECONDS_PER_FRAME > 0) {
|
||||
/* apply friction */
|
||||
shipData.vx -= dirx * FRICTION * MILLESECONDS_PER_FRAME;
|
||||
shipData.vy -= diry * FRICTION * MILLESECONDS_PER_FRAME;
|
||||
} else {
|
||||
/* applying friction would MORE than stop the ship, so just stop the ship */
|
||||
shipData.vx = 0.0f;
|
||||
shipData.vy = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
/* update ship location */
|
||||
shipData.x += shipData.vx * MILLESECONDS_PER_FRAME;
|
||||
shipData.y += shipData.vy * MILLESECONDS_PER_FRAME;
|
||||
|
||||
if (shipData.x > maxx) {
|
||||
shipData.x = maxx;
|
||||
shipData.vx = -shipData.vx * DAMPING;
|
||||
} else if (shipData.x < minx) {
|
||||
shipData.x = minx;
|
||||
shipData.vx = -shipData.vx * DAMPING;
|
||||
}
|
||||
if (shipData.y > maxy) {
|
||||
shipData.y = maxy;
|
||||
shipData.vy = -shipData.vy * DAMPING;
|
||||
} else if (shipData.y < miny) {
|
||||
shipData.y = miny;
|
||||
shipData.vy = -shipData.vy * DAMPING;
|
||||
}
|
||||
|
||||
/* draw the background */
|
||||
SDL_RenderCopy(renderer, space, NULL, NULL);
|
||||
|
||||
/* draw the ship */
|
||||
shipData.rect.x = shipData.x;
|
||||
shipData.rect.y = shipData.y;
|
||||
|
||||
SDL_RenderCopy(renderer, ship, NULL, &shipData.rect);
|
||||
|
||||
/* update screen */
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
initializeTextures(SDL_Renderer *renderer)
|
||||
{
|
||||
|
||||
SDL_Surface *bmp_surface;
|
||||
|
||||
/* load the ship */
|
||||
bmp_surface = SDL_LoadBMP("ship.bmp");
|
||||
if (bmp_surface == NULL) {
|
||||
fatalError("could not ship.bmp");
|
||||
}
|
||||
/* set blue to transparent on the ship */
|
||||
SDL_SetColorKey(bmp_surface, 1,
|
||||
SDL_MapRGB(bmp_surface->format, 0, 0, 255));
|
||||
|
||||
/* create ship texture from surface */
|
||||
ship = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
if (ship == 0) {
|
||||
fatalError("could not create ship texture");
|
||||
}
|
||||
SDL_SetTextureBlendMode(ship, SDL_BLENDMODE_BLEND);
|
||||
|
||||
/* set the width and height of the ship from the surface dimensions */
|
||||
shipData.rect.w = bmp_surface->w;
|
||||
shipData.rect.h = bmp_surface->h;
|
||||
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
|
||||
/* load the space background */
|
||||
bmp_surface = SDL_LoadBMP("space.bmp");
|
||||
if (bmp_surface == NULL) {
|
||||
fatalError("could not load space.bmp");
|
||||
}
|
||||
/* create space texture from surface */
|
||||
space = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
if (space == 0) {
|
||||
fatalError("could not create space texture");
|
||||
}
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
SDL_Window *window; /* main window */
|
||||
SDL_Renderer *renderer;
|
||||
Uint32 startFrame; /* time frame began to process */
|
||||
Uint32 endFrame; /* time frame ended processing */
|
||||
Sint32 delay; /* time to pause waiting to draw next frame */
|
||||
int done; /* should we clean up and exit? */
|
||||
int w, h;
|
||||
|
||||
/* initialize SDL */
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) {
|
||||
fatalError("Could not initialize SDL");
|
||||
}
|
||||
|
||||
/* create main window and renderer */
|
||||
window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
SDL_WINDOW_OPENGL |
|
||||
SDL_WINDOW_FULLSCREEN);
|
||||
renderer = SDL_CreateRenderer(window, 0, 0);
|
||||
|
||||
SDL_GetWindowSize(window, &w, &h);
|
||||
|
||||
/* print out some info about joysticks and try to open accelerometer for use */
|
||||
printf("There are %d joysticks available\n", SDL_NumJoysticks());
|
||||
printf("Default joystick (index 0) is %s\n", SDL_JoystickName(0));
|
||||
accelerometer = SDL_JoystickOpen(0);
|
||||
if (accelerometer == NULL) {
|
||||
fatalError("Could not open joystick (accelerometer)");
|
||||
}
|
||||
printf("joystick number of axis = %d\n",
|
||||
SDL_JoystickNumAxes(accelerometer));
|
||||
printf("joystick number of hats = %d\n",
|
||||
SDL_JoystickNumHats(accelerometer));
|
||||
printf("joystick number of balls = %d\n",
|
||||
SDL_JoystickNumBalls(accelerometer));
|
||||
printf("joystick number of buttons = %d\n",
|
||||
SDL_JoystickNumButtons(accelerometer));
|
||||
|
||||
/* load graphics */
|
||||
initializeTextures(renderer);
|
||||
|
||||
/* setup ship */
|
||||
shipData.x = (w - shipData.rect.w) / 2;
|
||||
shipData.y = (h - shipData.rect.h) / 2;
|
||||
shipData.vx = 0.0f;
|
||||
shipData.vy = 0.0f;
|
||||
|
||||
done = 0;
|
||||
/* enter main loop */
|
||||
while (!done) {
|
||||
startFrame = SDL_GetTicks();
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
if (event.type == SDL_QUIT) {
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
render(renderer, w, h);
|
||||
endFrame = SDL_GetTicks();
|
||||
|
||||
/* figure out how much time we have left, and then sleep */
|
||||
delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
|
||||
if (delay < 0) {
|
||||
delay = 0;
|
||||
} else if (delay > MILLESECONDS_PER_FRAME) {
|
||||
delay = MILLESECONDS_PER_FRAME;
|
||||
}
|
||||
SDL_Delay(delay);
|
||||
}
|
||||
|
||||
/* delete textures */
|
||||
SDL_DestroyTexture(ship);
|
||||
SDL_DestroyTexture(space);
|
||||
|
||||
/* shutdown SDL */
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
36
Engine/lib/sdl/Xcode-iOS/Demos/src/common.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* common.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "SDL.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/*
|
||||
Produces a random int x, min <= x <= max
|
||||
following a uniform distribution
|
||||
*/
|
||||
int
|
||||
randomInt(int min, int max)
|
||||
{
|
||||
return min + rand() % (max - min + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
Produces a random float x, min <= x <= max
|
||||
following a uniform distribution
|
||||
*/
|
||||
float
|
||||
randomFloat(float min, float max)
|
||||
{
|
||||
return rand() / (float) RAND_MAX *(max - min) + min;
|
||||
}
|
||||
|
||||
void
|
||||
fatalError(const char *string)
|
||||
{
|
||||
printf("%s: %s\n", string, SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
12
Engine/lib/sdl/Xcode-iOS/Demos/src/common.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* common.h
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 480
|
||||
|
||||
extern int randomInt(int min, int max);
|
||||
extern float randomFloat(float min, float max);
|
||||
extern void fatalError(const char *string);
|
||||
475
Engine/lib/sdl/Xcode-iOS/Demos/src/fireworks.c
Normal file
|
|
@ -0,0 +1,475 @@
|
|||
/*
|
||||
* fireworks.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include "SDL_opengles.h"
|
||||
#include "common.h"
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */
|
||||
#define ACCEL 0.0001f /* acceleration due to gravity, units in pixels per millesecond squared */
|
||||
#define WIND_RESISTANCE 0.00005f /* acceleration per unit velocity due to wind resistance */
|
||||
#define MAX_PARTICLES 2000 /* maximum number of particles displayed at once */
|
||||
|
||||
static GLuint particleTextureID; /* OpenGL particle texture id */
|
||||
static SDL_bool pointSizeExtensionSupported; /* is GL_OES_point_size_array supported ? */
|
||||
/*
|
||||
used to describe what type of particle a given struct particle is.
|
||||
emitter - this particle flies up, shooting off trail particles, then finally explodes into dust particles.
|
||||
trail - shoots off, following emitter particle
|
||||
dust - radiates outwards from emitter explosion
|
||||
*/
|
||||
enum particleType
|
||||
{
|
||||
emitter = 0,
|
||||
trail,
|
||||
dust
|
||||
};
|
||||
/*
|
||||
struct particle is used to describe each particle displayed on screen
|
||||
*/
|
||||
struct particle
|
||||
{
|
||||
GLfloat x; /* x position of particle */
|
||||
GLfloat y; /* y position of particle */
|
||||
GLubyte color[4]; /* rgba color of particle */
|
||||
GLfloat size; /* size of particle in pixels */
|
||||
GLfloat xvel; /* x velocity of particle in pixels per milesecond */
|
||||
GLfloat yvel; /* y velocity of particle in pixels per millescond */
|
||||
int isActive; /* if not active, then particle is overwritten */
|
||||
enum particleType type; /* see enum particleType */
|
||||
} particles[MAX_PARTICLES]; /* this array holds all our particles */
|
||||
|
||||
static int num_active_particles; /* how many members of the particle array are actually being drawn / animated? */
|
||||
static int screen_w, screen_h;
|
||||
|
||||
/* function declarations */
|
||||
void spawnTrailFromEmitter(struct particle *emitter);
|
||||
void spawnEmitterParticle(GLfloat x, GLfloat y);
|
||||
void explodeEmitter(struct particle *emitter);
|
||||
void initializeParticles(void);
|
||||
void initializeTexture();
|
||||
int nextPowerOfTwo(int x);
|
||||
void drawParticles();
|
||||
void stepParticles(void);
|
||||
|
||||
/* helper function (used in texture loading)
|
||||
returns next power of two greater than or equal to x
|
||||
*/
|
||||
int
|
||||
nextPowerOfTwo(int x)
|
||||
{
|
||||
int val = 1;
|
||||
while (val < x) {
|
||||
val *= 2;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
steps each active particle by timestep MILLESECONDS_PER_FRAME
|
||||
*/
|
||||
void
|
||||
stepParticles(void)
|
||||
{
|
||||
int i;
|
||||
struct particle *slot = particles;
|
||||
struct particle *curr = particles;
|
||||
for (i = 0; i < num_active_particles; i++) {
|
||||
/* is the particle actually active, or is it marked for deletion? */
|
||||
if (curr->isActive) {
|
||||
/* is the particle off the screen? */
|
||||
if (curr->y > screen_h)
|
||||
curr->isActive = 0;
|
||||
else if (curr->y < 0)
|
||||
curr->isActive = 0;
|
||||
if (curr->x > screen_w)
|
||||
curr->isActive = 0;
|
||||
else if (curr->x < 0)
|
||||
curr->isActive = 0;
|
||||
|
||||
/* step velocity, then step position */
|
||||
curr->yvel += ACCEL * MILLESECONDS_PER_FRAME;
|
||||
curr->xvel += 0.0f;
|
||||
curr->y += curr->yvel * MILLESECONDS_PER_FRAME;
|
||||
curr->x += curr->xvel * MILLESECONDS_PER_FRAME;
|
||||
|
||||
/* particle behavior */
|
||||
if (curr->type == emitter) {
|
||||
/* if we're an emitter, spawn a trail */
|
||||
spawnTrailFromEmitter(curr);
|
||||
/* if we've reached our peak, explode */
|
||||
if (curr->yvel > 0.0) {
|
||||
explodeEmitter(curr);
|
||||
}
|
||||
} else {
|
||||
float speed =
|
||||
sqrt(curr->xvel * curr->xvel + curr->yvel * curr->yvel);
|
||||
/* if wind resistance is not powerful enough to stop us completely,
|
||||
then apply winde resistance, otherwise just stop us completely */
|
||||
if (WIND_RESISTANCE * MILLESECONDS_PER_FRAME < speed) {
|
||||
float normx = curr->xvel / speed;
|
||||
float normy = curr->yvel / speed;
|
||||
curr->xvel -=
|
||||
normx * WIND_RESISTANCE * MILLESECONDS_PER_FRAME;
|
||||
curr->yvel -=
|
||||
normy * WIND_RESISTANCE * MILLESECONDS_PER_FRAME;
|
||||
} else {
|
||||
curr->xvel = curr->yvel = 0; /* stop particle */
|
||||
}
|
||||
|
||||
if (curr->color[3] <= MILLESECONDS_PER_FRAME * 0.1275f) {
|
||||
/* if this next step will cause us to fade out completely
|
||||
then just mark for deletion */
|
||||
curr->isActive = 0;
|
||||
} else {
|
||||
/* otherwise, let's fade a bit more */
|
||||
curr->color[3] -= MILLESECONDS_PER_FRAME * 0.1275f;
|
||||
}
|
||||
|
||||
/* if we're a dust particle, shrink our size */
|
||||
if (curr->type == dust)
|
||||
curr->size -= MILLESECONDS_PER_FRAME * 0.010f;
|
||||
|
||||
}
|
||||
|
||||
/* if we're still active, pack ourselves in the array next
|
||||
to the last active guy (pack the array tightly) */
|
||||
if (curr->isActive)
|
||||
*(slot++) = *curr;
|
||||
} /* endif (curr->isActive) */
|
||||
curr++;
|
||||
}
|
||||
/* the number of active particles is computed as the difference between
|
||||
old number of active particles, where slot points, and the
|
||||
new size of the array, where particles points */
|
||||
num_active_particles = slot - particles;
|
||||
}
|
||||
|
||||
/*
|
||||
This draws all the particles shown on screen
|
||||
*/
|
||||
void
|
||||
drawParticles()
|
||||
{
|
||||
|
||||
/* draw the background */
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* set up the position and color pointers */
|
||||
glVertexPointer(2, GL_FLOAT, sizeof(struct particle), particles);
|
||||
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(struct particle),
|
||||
particles[0].color);
|
||||
|
||||
if (pointSizeExtensionSupported) {
|
||||
/* pass in our array of point sizes */
|
||||
glPointSizePointerOES(GL_FLOAT, sizeof(struct particle),
|
||||
&(particles[0].size));
|
||||
}
|
||||
|
||||
/* draw our particles! */
|
||||
glDrawArrays(GL_POINTS, 0, num_active_particles);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
This causes an emitter to explode in a circular bloom of dust particles
|
||||
*/
|
||||
void
|
||||
explodeEmitter(struct particle *emitter)
|
||||
{
|
||||
/* first off, we're done with this particle, so turn active off */
|
||||
emitter->isActive = 0;
|
||||
int i;
|
||||
for (i = 0; i < 200; i++) {
|
||||
|
||||
if (num_active_particles >= MAX_PARTICLES)
|
||||
return;
|
||||
|
||||
/* come up with a random angle and speed for new particle */
|
||||
float theta = randomFloat(0, 2.0f * 3.141592);
|
||||
float exponent = 3.0f;
|
||||
float speed = randomFloat(0.00, powf(0.17, exponent));
|
||||
speed = powf(speed, 1.0f / exponent);
|
||||
|
||||
/* select the particle at the end of our array */
|
||||
struct particle *p = &particles[num_active_particles];
|
||||
|
||||
/* set the particles properties */
|
||||
p->xvel = speed * cos(theta);
|
||||
p->yvel = speed * sin(theta);
|
||||
p->x = emitter->x + emitter->xvel;
|
||||
p->y = emitter->y + emitter->yvel;
|
||||
p->isActive = 1;
|
||||
p->type = dust;
|
||||
p->size = 15;
|
||||
/* inherit emitter's color */
|
||||
p->color[0] = emitter->color[0];
|
||||
p->color[1] = emitter->color[1];
|
||||
p->color[2] = emitter->color[2];
|
||||
p->color[3] = 255;
|
||||
/* our array has expanded at the end */
|
||||
num_active_particles++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
This spawns a trail particle from an emitter
|
||||
*/
|
||||
void
|
||||
spawnTrailFromEmitter(struct particle *emitter)
|
||||
{
|
||||
|
||||
if (num_active_particles >= MAX_PARTICLES)
|
||||
return;
|
||||
|
||||
/* select the particle at the slot at the end of our array */
|
||||
struct particle *p = &particles[num_active_particles];
|
||||
|
||||
/* set position and velocity to roughly that of the emitter */
|
||||
p->x = emitter->x + randomFloat(-3.0, 3.0);
|
||||
p->y = emitter->y + emitter->size / 2.0f;
|
||||
p->xvel = emitter->xvel + randomFloat(-0.005, 0.005);
|
||||
p->yvel = emitter->yvel + 0.1;
|
||||
|
||||
/* set the color to a random-ish orangy type color */
|
||||
p->color[0] = (0.8f + randomFloat(-0.1, 0.0)) * 255;
|
||||
p->color[1] = (0.4f + randomFloat(-0.1, 0.1)) * 255;
|
||||
p->color[2] = (0.0f + randomFloat(0.0, 0.2)) * 255;
|
||||
p->color[3] = (0.7f) * 255;
|
||||
|
||||
/* set other attributes */
|
||||
p->size = 10;
|
||||
p->type = trail;
|
||||
p->isActive = 1;
|
||||
|
||||
/* our array has expanded at the end */
|
||||
num_active_particles++;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
spawns a new emitter particle at the bottom of the screen
|
||||
destined for the point (x,y).
|
||||
*/
|
||||
void
|
||||
spawnEmitterParticle(GLfloat x, GLfloat y)
|
||||
{
|
||||
|
||||
if (num_active_particles >= MAX_PARTICLES)
|
||||
return;
|
||||
|
||||
/* find particle at endpoint of array */
|
||||
struct particle *p = &particles[num_active_particles];
|
||||
|
||||
/* set the color randomly */
|
||||
switch (rand() % 4) {
|
||||
case 0:
|
||||
p->color[0] = 255;
|
||||
p->color[1] = 100;
|
||||
p->color[2] = 100;
|
||||
break;
|
||||
case 1:
|
||||
p->color[0] = 100;
|
||||
p->color[1] = 255;
|
||||
p->color[2] = 100;
|
||||
break;
|
||||
case 2:
|
||||
p->color[0] = 100;
|
||||
p->color[1] = 100;
|
||||
p->color[2] = 255;
|
||||
break;
|
||||
case 3:
|
||||
p->color[0] = 255;
|
||||
p->color[1] = 150;
|
||||
p->color[2] = 50;
|
||||
break;
|
||||
}
|
||||
p->color[3] = 255;
|
||||
/* set position to (x, screen_h) */
|
||||
p->x = x;
|
||||
p->y = screen_h;
|
||||
/* set velocity so that terminal point is (x,y) */
|
||||
p->xvel = 0;
|
||||
p->yvel = -sqrt(2 * ACCEL * (screen_h - y));
|
||||
/* set other attributes */
|
||||
p->size = 10;
|
||||
p->type = emitter;
|
||||
p->isActive = 1;
|
||||
/* our array has expanded at the end */
|
||||
num_active_particles++;
|
||||
}
|
||||
|
||||
/* just sets the endpoint of the particle array to element zero */
|
||||
void
|
||||
initializeParticles(void)
|
||||
{
|
||||
num_active_particles = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
loads the particle texture
|
||||
*/
|
||||
void
|
||||
initializeTexture()
|
||||
{
|
||||
|
||||
int bpp; /* texture bits per pixel */
|
||||
Uint32 Rmask, Gmask, Bmask, Amask; /* masks for pixel format passed into OpenGL */
|
||||
SDL_Surface *bmp_surface; /* the bmp is loaded here */
|
||||
SDL_Surface *bmp_surface_rgba8888; /* this serves as a destination to convert the BMP
|
||||
to format passed into OpenGL */
|
||||
|
||||
bmp_surface = SDL_LoadBMP("stroke.bmp");
|
||||
if (bmp_surface == NULL) {
|
||||
fatalError("could not load stroke.bmp");
|
||||
}
|
||||
|
||||
/* Grab info about format that will be passed into OpenGL */
|
||||
SDL_PixelFormatEnumToMasks(SDL_PIXELFORMAT_ABGR8888, &bpp, &Rmask, &Gmask,
|
||||
&Bmask, &Amask);
|
||||
/* Create surface that will hold pixels passed into OpenGL */
|
||||
bmp_surface_rgba8888 =
|
||||
SDL_CreateRGBSurface(0, bmp_surface->w, bmp_surface->h, bpp, Rmask,
|
||||
Gmask, Bmask, Amask);
|
||||
/* Blit to this surface, effectively converting the format */
|
||||
SDL_BlitSurface(bmp_surface, NULL, bmp_surface_rgba8888, NULL);
|
||||
|
||||
glGenTextures(1, &particleTextureID);
|
||||
glBindTexture(GL_TEXTURE_2D, particleTextureID);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
|
||||
nextPowerOfTwo(bmp_surface->w),
|
||||
nextPowerOfTwo(bmp_surface->h),
|
||||
0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
/* this is where we actually pass in the pixel data */
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bmp_surface->w, bmp_surface->h, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, bmp_surface_rgba8888->pixels);
|
||||
|
||||
/* free bmp surface and converted bmp surface */
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
SDL_FreeSurface(bmp_surface_rgba8888);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
SDL_Window *window; /* main window */
|
||||
SDL_GLContext context;
|
||||
int w, h;
|
||||
Uint32 startFrame; /* time frame began to process */
|
||||
Uint32 endFrame; /* time frame ended processing */
|
||||
Uint32 delay; /* time to pause waiting to draw next frame */
|
||||
int done; /* should we clean up and exit? */
|
||||
|
||||
/* initialize SDL */
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
fatalError("Could not initialize SDL");
|
||||
}
|
||||
/* seed the random number generator */
|
||||
srand(time(NULL));
|
||||
/*
|
||||
request some OpenGL parameters
|
||||
that may speed drawing
|
||||
*/
|
||||
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
|
||||
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
|
||||
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
|
||||
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
|
||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
|
||||
SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 0);
|
||||
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
|
||||
|
||||
/* create main window and renderer */
|
||||
window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
SDL_WINDOW_OPENGL |
|
||||
SDL_WINDOW_BORDERLESS);
|
||||
context = SDL_GL_CreateContext(window);
|
||||
|
||||
/* load the particle texture */
|
||||
initializeTexture();
|
||||
|
||||
/* check if GL_POINT_SIZE_ARRAY_OES is supported
|
||||
this is used to give each particle its own size
|
||||
*/
|
||||
pointSizeExtensionSupported =
|
||||
SDL_GL_ExtensionSupported("GL_OES_point_size_array");
|
||||
|
||||
/* set up some OpenGL state */
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
SDL_GetWindowSize(window, &screen_w, &screen_h);
|
||||
glViewport(0, 0, screen_w, screen_h);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrthof((GLfloat) 0,
|
||||
(GLfloat) screen_w,
|
||||
(GLfloat) screen_h,
|
||||
(GLfloat) 0, 0.0, 1.0);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
|
||||
glEnable(GL_POINT_SPRITE_OES);
|
||||
glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, 1);
|
||||
|
||||
if (pointSizeExtensionSupported) {
|
||||
/* we use this to set the sizes of all the particles */
|
||||
glEnableClientState(GL_POINT_SIZE_ARRAY_OES);
|
||||
} else {
|
||||
/* if extension not available then all particles have size 10 */
|
||||
glPointSize(10);
|
||||
}
|
||||
|
||||
done = 0;
|
||||
/* enter main loop */
|
||||
while (!done) {
|
||||
startFrame = SDL_GetTicks();
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
if (event.type == SDL_QUIT) {
|
||||
done = 1;
|
||||
}
|
||||
if (event.type == SDL_MOUSEBUTTONDOWN) {
|
||||
int x, y;
|
||||
SDL_GetMouseState(&x, &y);
|
||||
spawnEmitterParticle(x, y);
|
||||
}
|
||||
}
|
||||
stepParticles();
|
||||
drawParticles();
|
||||
SDL_GL_SwapWindow(window);
|
||||
endFrame = SDL_GetTicks();
|
||||
|
||||
/* figure out how much time we have left, and then sleep */
|
||||
delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
|
||||
if (delay > MILLESECONDS_PER_FRAME) {
|
||||
delay = MILLESECONDS_PER_FRAME;
|
||||
}
|
||||
if (delay > 0) {
|
||||
SDL_Delay(delay);
|
||||
}
|
||||
}
|
||||
|
||||
/* delete textures */
|
||||
glDeleteTextures(1, &particleTextureID);
|
||||
/* shutdown SDL */
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
177
Engine/lib/sdl/Xcode-iOS/Demos/src/happy.c
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
/*
|
||||
* happy.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include "common.h"
|
||||
|
||||
#define NUM_HAPPY_FACES 100 /* number of faces to draw */
|
||||
#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */
|
||||
#define HAPPY_FACE_SIZE 32 /* width and height of happyface (pixels) */
|
||||
|
||||
static SDL_Texture *texture = 0; /* reference to texture holding happyface */
|
||||
|
||||
static struct
|
||||
{
|
||||
float x, y; /* position of happyface */
|
||||
float xvel, yvel; /* velocity of happyface */
|
||||
} faces[NUM_HAPPY_FACES];
|
||||
|
||||
/*
|
||||
Sets initial positions and velocities of happyfaces
|
||||
units of velocity are pixels per millesecond
|
||||
*/
|
||||
void
|
||||
initializeHappyFaces()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < NUM_HAPPY_FACES; i++) {
|
||||
faces[i].x = randomFloat(0.0f, SCREEN_WIDTH - HAPPY_FACE_SIZE);
|
||||
faces[i].y = randomFloat(0.0f, SCREEN_HEIGHT - HAPPY_FACE_SIZE);
|
||||
faces[i].xvel = randomFloat(-0.1f, 0.1f);
|
||||
faces[i].yvel = randomFloat(-0.1f, 0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
render(SDL_Renderer *renderer)
|
||||
{
|
||||
|
||||
int i;
|
||||
SDL_Rect srcRect;
|
||||
SDL_Rect dstRect;
|
||||
|
||||
/* setup boundaries for happyface bouncing */
|
||||
Uint16 maxx = SCREEN_WIDTH - HAPPY_FACE_SIZE;
|
||||
Uint16 maxy = SCREEN_HEIGHT - HAPPY_FACE_SIZE;
|
||||
Uint16 minx = 0;
|
||||
Uint16 miny = 0;
|
||||
|
||||
/* setup rects for drawing */
|
||||
srcRect.x = 0;
|
||||
srcRect.y = 0;
|
||||
srcRect.w = HAPPY_FACE_SIZE;
|
||||
srcRect.h = HAPPY_FACE_SIZE;
|
||||
dstRect.w = HAPPY_FACE_SIZE;
|
||||
dstRect.h = HAPPY_FACE_SIZE;
|
||||
|
||||
/* fill background in with black */
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
/*
|
||||
loop through all the happy faces:
|
||||
- update position
|
||||
- update velocity (if boundary is hit)
|
||||
- draw
|
||||
*/
|
||||
for (i = 0; i < NUM_HAPPY_FACES; i++) {
|
||||
faces[i].x += faces[i].xvel * MILLESECONDS_PER_FRAME;
|
||||
faces[i].y += faces[i].yvel * MILLESECONDS_PER_FRAME;
|
||||
if (faces[i].x > maxx) {
|
||||
faces[i].x = maxx;
|
||||
faces[i].xvel = -faces[i].xvel;
|
||||
} else if (faces[i].y > maxy) {
|
||||
faces[i].y = maxy;
|
||||
faces[i].yvel = -faces[i].yvel;
|
||||
}
|
||||
if (faces[i].x < minx) {
|
||||
faces[i].x = minx;
|
||||
faces[i].xvel = -faces[i].xvel;
|
||||
} else if (faces[i].y < miny) {
|
||||
faces[i].y = miny;
|
||||
faces[i].yvel = -faces[i].yvel;
|
||||
}
|
||||
dstRect.x = faces[i].x;
|
||||
dstRect.y = faces[i].y;
|
||||
SDL_RenderCopy(renderer, texture, &srcRect, &dstRect);
|
||||
}
|
||||
/* update screen */
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
loads the happyface graphic into a texture
|
||||
*/
|
||||
void
|
||||
initializeTexture(SDL_Renderer *renderer)
|
||||
{
|
||||
SDL_Surface *bmp_surface;
|
||||
/* load the bmp */
|
||||
bmp_surface = SDL_LoadBMP("icon.bmp");
|
||||
if (bmp_surface == NULL) {
|
||||
fatalError("could not load bmp");
|
||||
}
|
||||
/* set white to transparent on the happyface */
|
||||
SDL_SetColorKey(bmp_surface, 1,
|
||||
SDL_MapRGB(bmp_surface->format, 255, 255, 255));
|
||||
|
||||
/* convert RGBA surface to texture */
|
||||
texture = SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
if (texture == 0) {
|
||||
fatalError("could not create texture");
|
||||
}
|
||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
||||
|
||||
/* free up allocated memory */
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
SDL_Window *window;
|
||||
SDL_Renderer *renderer;
|
||||
Uint32 startFrame;
|
||||
Uint32 endFrame;
|
||||
Uint32 delay;
|
||||
int done;
|
||||
|
||||
/* initialize SDL */
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
fatalError("Could not initialize SDL");
|
||||
}
|
||||
window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
SDL_WINDOW_OPENGL |
|
||||
SDL_WINDOW_BORDERLESS);
|
||||
|
||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
||||
|
||||
initializeTexture(renderer);
|
||||
initializeHappyFaces();
|
||||
|
||||
/* main loop */
|
||||
done = 0;
|
||||
while (!done) {
|
||||
startFrame = SDL_GetTicks();
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
if (event.type == SDL_QUIT) {
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
render(renderer);
|
||||
endFrame = SDL_GetTicks();
|
||||
|
||||
/* figure out how much time we have left, and then sleep */
|
||||
delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
|
||||
if (delay < 0) {
|
||||
delay = 0;
|
||||
} else if (delay > MILLESECONDS_PER_FRAME) {
|
||||
delay = MILLESECONDS_PER_FRAME;
|
||||
}
|
||||
SDL_Delay(delay);
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
SDL_DestroyTexture(texture);
|
||||
/* shutdown SDL */
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
310
Engine/lib/sdl/Xcode-iOS/Demos/src/keyboard.c
Normal file
|
|
@ -0,0 +1,310 @@
|
|||
/*
|
||||
* keyboard.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#import "SDL.h"
|
||||
#import "common.h"
|
||||
|
||||
#define GLYPH_SIZE_IMAGE 16 /* size of glyphs (characters) in the bitmap font file */
|
||||
#define GLYPH_SIZE_SCREEN 32 /* size of glyphs (characters) as shown on the screen */
|
||||
|
||||
static SDL_Texture *texture; /* texture where we'll hold our font */
|
||||
|
||||
/* function declarations */
|
||||
void cleanup(void);
|
||||
void drawBlank(int x, int y);
|
||||
|
||||
static SDL_Renderer *renderer;
|
||||
static int numChars = 0; /* number of characters we've typed so far */
|
||||
static SDL_bool lastCharWasColon = 0; /* we use this to detect sequences such as :) */
|
||||
static SDL_Color bg_color = { 50, 50, 100, 255 }; /* color of background */
|
||||
|
||||
/* this structure maps a scancode to an index in our bitmap font.
|
||||
it also contains data about under which modifiers the mapping is valid
|
||||
(for example, we don't want shift + 1 to produce the character '1',
|
||||
but rather the character '!')
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
SDL_Scancode scancode; /* scancode of the key we want to map */
|
||||
int allow_no_mod; /* is the map valid if the key has no modifiers? */
|
||||
SDL_Keymod mod; /* what modifiers are allowed for the mapping */
|
||||
int index; /* what index in the font does the scancode map to */
|
||||
} fontMapping;
|
||||
|
||||
#define TABLE_SIZE 51 /* size of our table which maps keys and modifiers to font indices */
|
||||
|
||||
/* Below is the table that defines the mapping between scancodes and modifiers to indices in the
|
||||
bitmap font. As an example, then line '{ SDL_SCANCODE_A, 1, KMOD_SHIFT, 33 }' means, map
|
||||
the key A (which has scancode SDL_SCANCODE_A) to index 33 in the font (which is a picture of an A),
|
||||
The '1' means that the mapping is valid even if there are no modifiers, and KMOD_SHIFT means the
|
||||
mapping is also valid if the user is holding shift.
|
||||
*/
|
||||
fontMapping map[TABLE_SIZE] = {
|
||||
|
||||
{SDL_SCANCODE_A, 1, KMOD_SHIFT, 33}, /* A */
|
||||
{SDL_SCANCODE_B, 1, KMOD_SHIFT, 34}, /* B */
|
||||
{SDL_SCANCODE_C, 1, KMOD_SHIFT, 35}, /* C */
|
||||
{SDL_SCANCODE_D, 1, KMOD_SHIFT, 36}, /* D */
|
||||
{SDL_SCANCODE_E, 1, KMOD_SHIFT, 37}, /* E */
|
||||
{SDL_SCANCODE_F, 1, KMOD_SHIFT, 38}, /* F */
|
||||
{SDL_SCANCODE_G, 1, KMOD_SHIFT, 39}, /* G */
|
||||
{SDL_SCANCODE_H, 1, KMOD_SHIFT, 40}, /* H */
|
||||
{SDL_SCANCODE_I, 1, KMOD_SHIFT, 41}, /* I */
|
||||
{SDL_SCANCODE_J, 1, KMOD_SHIFT, 42}, /* J */
|
||||
{SDL_SCANCODE_K, 1, KMOD_SHIFT, 43}, /* K */
|
||||
{SDL_SCANCODE_L, 1, KMOD_SHIFT, 44}, /* L */
|
||||
{SDL_SCANCODE_M, 1, KMOD_SHIFT, 45}, /* M */
|
||||
{SDL_SCANCODE_N, 1, KMOD_SHIFT, 46}, /* N */
|
||||
{SDL_SCANCODE_O, 1, KMOD_SHIFT, 47}, /* O */
|
||||
{SDL_SCANCODE_P, 1, KMOD_SHIFT, 48}, /* P */
|
||||
{SDL_SCANCODE_Q, 1, KMOD_SHIFT, 49}, /* Q */
|
||||
{SDL_SCANCODE_R, 1, KMOD_SHIFT, 50}, /* R */
|
||||
{SDL_SCANCODE_S, 1, KMOD_SHIFT, 51}, /* S */
|
||||
{SDL_SCANCODE_T, 1, KMOD_SHIFT, 52}, /* T */
|
||||
{SDL_SCANCODE_U, 1, KMOD_SHIFT, 53}, /* U */
|
||||
{SDL_SCANCODE_V, 1, KMOD_SHIFT, 54}, /* V */
|
||||
{SDL_SCANCODE_W, 1, KMOD_SHIFT, 55}, /* W */
|
||||
{SDL_SCANCODE_X, 1, KMOD_SHIFT, 56}, /* X */
|
||||
{SDL_SCANCODE_Y, 1, KMOD_SHIFT, 57}, /* Y */
|
||||
{SDL_SCANCODE_Z, 1, KMOD_SHIFT, 58}, /* Z */
|
||||
{SDL_SCANCODE_0, 1, 0, 16}, /* 0 */
|
||||
{SDL_SCANCODE_1, 1, 0, 17}, /* 1 */
|
||||
{SDL_SCANCODE_2, 1, 0, 18}, /* 2 */
|
||||
{SDL_SCANCODE_3, 1, 0, 19}, /* 3 */
|
||||
{SDL_SCANCODE_4, 1, 0, 20}, /* 4 */
|
||||
{SDL_SCANCODE_5, 1, 0, 21}, /* 5 */
|
||||
{SDL_SCANCODE_6, 1, 0, 22}, /* 6 */
|
||||
{SDL_SCANCODE_7, 1, 0, 23}, /* 7 */
|
||||
{SDL_SCANCODE_8, 1, 0, 24}, /* 8 */
|
||||
{SDL_SCANCODE_9, 1, 0, 25}, /* 9 */
|
||||
{SDL_SCANCODE_SPACE, 1, 0, 0}, /* ' ' */
|
||||
{SDL_SCANCODE_1, 0, KMOD_SHIFT, 1}, /* ! */
|
||||
{SDL_SCANCODE_SLASH, 0, KMOD_SHIFT, 31}, /* ? */
|
||||
{SDL_SCANCODE_SLASH, 1, 0, 15}, /* / */
|
||||
{SDL_SCANCODE_COMMA, 1, 0, 12}, /* , */
|
||||
{SDL_SCANCODE_SEMICOLON, 1, 0, 27}, /* ; */
|
||||
{SDL_SCANCODE_SEMICOLON, 0, KMOD_SHIFT, 26}, /* : */
|
||||
{SDL_SCANCODE_PERIOD, 1, 0, 14}, /* . */
|
||||
{SDL_SCANCODE_MINUS, 1, 0, 13}, /* - */
|
||||
{SDL_SCANCODE_EQUALS, 0, KMOD_SHIFT, 11}, /* = */
|
||||
{SDL_SCANCODE_APOSTROPHE, 1, 0, 7}, /* ' */
|
||||
{SDL_SCANCODE_APOSTROPHE, 0, KMOD_SHIFT, 2}, /* " */
|
||||
{SDL_SCANCODE_5, 0, KMOD_SHIFT, 5}, /* % */
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
This function maps an SDL_KeySym to an index in the bitmap font.
|
||||
It does so by scanning through the font mapping table one entry
|
||||
at a time.
|
||||
|
||||
If a match is found (scancode and allowed modifiers), the proper
|
||||
index is returned.
|
||||
|
||||
If there is no entry for the key, -1 is returned
|
||||
*/
|
||||
int
|
||||
keyToIndex(SDL_Keysym key)
|
||||
{
|
||||
int i, index = -1;
|
||||
for (i = 0; i < TABLE_SIZE; i++) {
|
||||
fontMapping compare = map[i];
|
||||
if (key.scancode == compare.scancode) {
|
||||
/* if this entry is valid with no key mod and we have no keymod, or if
|
||||
the key's modifiers are allowed modifiers for that mapping */
|
||||
if ((compare.allow_no_mod && key.mod == 0)
|
||||
|| (key.mod & compare.mod)) {
|
||||
index = compare.index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
/*
|
||||
This function returns and x,y position for a given character number.
|
||||
It is used for positioning each character of text
|
||||
*/
|
||||
void
|
||||
getPositionForCharNumber(int n, int *x, int *y)
|
||||
{
|
||||
int x_padding = 16; /* padding space on left and right side of screen */
|
||||
int y_padding = 32; /* padding space at top of screen */
|
||||
/* figure out the number of characters that can fit horizontally across the screen */
|
||||
int max_x_chars = (SCREEN_WIDTH - 2 * x_padding) / GLYPH_SIZE_SCREEN;
|
||||
int line_separation = 5; /* pixels between each line */
|
||||
*x = (n % max_x_chars) * GLYPH_SIZE_SCREEN + x_padding;
|
||||
*y = (n / max_x_chars) * (GLYPH_SIZE_SCREEN + line_separation) +
|
||||
y_padding;
|
||||
}
|
||||
|
||||
void
|
||||
drawIndex(int index)
|
||||
{
|
||||
int x, y;
|
||||
getPositionForCharNumber(numChars, &x, &y);
|
||||
SDL_Rect srcRect =
|
||||
{ GLYPH_SIZE_IMAGE * index, 0, GLYPH_SIZE_IMAGE, GLYPH_SIZE_IMAGE };
|
||||
SDL_Rect dstRect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN };
|
||||
drawBlank(x, y);
|
||||
SDL_RenderCopy(renderer, texture, &srcRect, &dstRect);
|
||||
}
|
||||
|
||||
/* draws the cursor icon at the current end position of the text */
|
||||
void
|
||||
drawCursor(void)
|
||||
{
|
||||
drawIndex(29); /* cursor is at index 29 in the bitmap font */
|
||||
}
|
||||
|
||||
/* paints over a glyph sized region with the background color
|
||||
in effect it erases the area
|
||||
*/
|
||||
void
|
||||
drawBlank(int x, int y)
|
||||
{
|
||||
SDL_Rect rect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN };
|
||||
SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a);
|
||||
SDL_RenderFillRect(renderer, &rect);
|
||||
}
|
||||
|
||||
/* moves backwards one character, erasing the last one put down */
|
||||
void
|
||||
backspace(void)
|
||||
{
|
||||
int x, y;
|
||||
if (numChars > 0) {
|
||||
getPositionForCharNumber(numChars, &x, &y);
|
||||
drawBlank(x, y);
|
||||
numChars--;
|
||||
getPositionForCharNumber(numChars, &x, &y);
|
||||
drawBlank(x, y);
|
||||
drawCursor();
|
||||
}
|
||||
}
|
||||
|
||||
/* this function loads our font into an SDL_Texture and returns the SDL_Texture */
|
||||
SDL_Texture*
|
||||
loadFont(void)
|
||||
{
|
||||
|
||||
SDL_Surface *surface = SDL_LoadBMP("kromasky_16x16.bmp");
|
||||
|
||||
if (!surface) {
|
||||
printf("Error loading bitmap: %s\n", SDL_GetError());
|
||||
return 0;
|
||||
} else {
|
||||
/* set the transparent color for the bitmap font (hot pink) */
|
||||
SDL_SetColorKey(surface, 1, SDL_MapRGB(surface->format, 238, 0, 252));
|
||||
/* now we convert the surface to our desired pixel format */
|
||||
int format = SDL_PIXELFORMAT_ABGR8888; /* desired texture format */
|
||||
Uint32 Rmask, Gmask, Bmask, Amask; /* masks for desired format */
|
||||
int bpp; /* bits per pixel for desired format */
|
||||
SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask,
|
||||
&Amask);
|
||||
SDL_Surface *converted =
|
||||
SDL_CreateRGBSurface(0, surface->w, surface->h, bpp, Rmask, Gmask,
|
||||
Bmask, Amask);
|
||||
SDL_BlitSurface(surface, NULL, converted, NULL);
|
||||
/* create our texture */
|
||||
texture =
|
||||
SDL_CreateTextureFromSurface(renderer, converted);
|
||||
if (texture == 0) {
|
||||
printf("texture creation failed: %s\n", SDL_GetError());
|
||||
} else {
|
||||
/* set blend mode for our texture */
|
||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
||||
}
|
||||
SDL_FreeSurface(surface);
|
||||
SDL_FreeSurface(converted);
|
||||
return texture;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
int index; /* index of last key we pushed in the bitmap font */
|
||||
SDL_Window *window;
|
||||
SDL_Event event; /* last event received */
|
||||
SDL_Keymod mod; /* key modifiers of last key we pushed */
|
||||
SDL_Scancode scancode; /* scancode of last key we pushed */
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
printf("Error initializing SDL: %s", SDL_GetError());
|
||||
}
|
||||
/* create window */
|
||||
window = SDL_CreateWindow("iPhone keyboard test", 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
|
||||
/* create renderer */
|
||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
||||
|
||||
/* load up our font */
|
||||
loadFont();
|
||||
|
||||
/* draw the background, we'll just paint over it */
|
||||
SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a);
|
||||
SDL_RenderFillRect(renderer, NULL);
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
int done = 0;
|
||||
/* loop till we get SDL_Quit */
|
||||
while (SDL_WaitEvent(&event)) {
|
||||
switch (event.type) {
|
||||
case SDL_QUIT:
|
||||
done = 1;
|
||||
break;
|
||||
case SDL_KEYDOWN:
|
||||
index = keyToIndex(event.key.keysym);
|
||||
scancode = event.key.keysym.scancode;
|
||||
mod = event.key.keysym.mod;
|
||||
if (scancode == SDL_SCANCODE_DELETE) {
|
||||
/* if user hit delete, delete the last character */
|
||||
backspace();
|
||||
lastCharWasColon = 0;
|
||||
} else if (lastCharWasColon && scancode == SDL_SCANCODE_0
|
||||
&& (mod & KMOD_SHIFT)) {
|
||||
/* if our last key was a colon and this one is a close paren, the make a hoppy face */
|
||||
backspace();
|
||||
drawIndex(32); /* index for happy face */
|
||||
numChars++;
|
||||
drawCursor();
|
||||
lastCharWasColon = 0;
|
||||
} else if (index != -1) {
|
||||
/* if we aren't doing a happy face, then just draw the normal character */
|
||||
drawIndex(index);
|
||||
numChars++;
|
||||
drawCursor();
|
||||
lastCharWasColon =
|
||||
(event.key.keysym.scancode == SDL_SCANCODE_SEMICOLON
|
||||
&& (event.key.keysym.mod & KMOD_SHIFT));
|
||||
}
|
||||
/* check if the key was a colon */
|
||||
/* draw our updates to the screen */
|
||||
SDL_RenderPresent(renderer);
|
||||
break;
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
/* mouse up toggles onscreen keyboard visibility */
|
||||
if (SDL_IsTextInputActive()) {
|
||||
SDL_StopTextInput();
|
||||
} else {
|
||||
SDL_StartTextInput();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* clean up after ourselves like a good kiddy */
|
||||
void
|
||||
cleanup(void)
|
||||
{
|
||||
SDL_DestroyTexture(texture);
|
||||
SDL_Quit();
|
||||
}
|
||||
353
Engine/lib/sdl/Xcode-iOS/Demos/src/mixer.c
Normal file
|
|
@ -0,0 +1,353 @@
|
|||
/*
|
||||
* mixer.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#import "SDL.h"
|
||||
#import "common.h"
|
||||
|
||||
#define NUM_CHANNELS 8 /* max number of sounds we can play at once */
|
||||
#define NUM_DRUMS 4 /* number of drums in our set */
|
||||
#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */
|
||||
|
||||
static struct
|
||||
{
|
||||
SDL_Rect rect; /* where the button is drawn */
|
||||
SDL_Color upColor; /* color when button is not active */
|
||||
SDL_Color downColor; /* color when button is active */
|
||||
int isPressed; /* is the button being pressed ? */
|
||||
int touchIndex; /* what mouse (touch) index pressed the button ? */
|
||||
} buttons[NUM_DRUMS];
|
||||
|
||||
struct sound
|
||||
{
|
||||
Uint8 *buffer; /* audio buffer for sound file */
|
||||
Uint32 length; /* length of the buffer (in bytes) */
|
||||
};
|
||||
|
||||
/* this array holds the audio for the drum noises */
|
||||
static struct sound drums[NUM_DRUMS];
|
||||
|
||||
/* function declarations */
|
||||
void handleMouseButtonDown(SDL_Event * event);
|
||||
void handleMouseButtonUp(SDL_Event * event);
|
||||
int playSound(struct sound *);
|
||||
void initializeButtons();
|
||||
void audioCallback(void *userdata, Uint8 * stream, int len);
|
||||
void loadSound(const char *file, struct sound *s);
|
||||
|
||||
struct
|
||||
{
|
||||
/* channel array holds information about currently playing sounds */
|
||||
struct
|
||||
{
|
||||
Uint8 *position; /* what is the current position in the buffer of this sound ? */
|
||||
Uint32 remaining; /* how many bytes remaining before we're done playing the sound ? */
|
||||
Uint32 timestamp; /* when did this sound start playing ? */
|
||||
} channels[NUM_CHANNELS];
|
||||
SDL_AudioSpec outputSpec; /* what audio format are we using for output? */
|
||||
int numSoundsPlaying; /* how many sounds are currently playing */
|
||||
} mixer;
|
||||
|
||||
/* sets up the buttons (color, position, state) */
|
||||
void
|
||||
initializeButtons()
|
||||
{
|
||||
|
||||
int i;
|
||||
int spacing = 10; /* gap between drum buttons */
|
||||
SDL_Rect buttonRect; /* keeps track of where to position drum */
|
||||
SDL_Color upColor = { 86, 86, 140, 255 }; /* color of drum when not pressed */
|
||||
SDL_Color downColor = { 191, 191, 221, 255 }; /* color of drum when pressed */
|
||||
|
||||
buttonRect.x = spacing;
|
||||
buttonRect.y = spacing;
|
||||
buttonRect.w = SCREEN_WIDTH - 2 * spacing;
|
||||
buttonRect.h = (SCREEN_HEIGHT - (NUM_DRUMS + 1) * spacing) / NUM_DRUMS;
|
||||
|
||||
/* setup each button */
|
||||
for (i = 0; i < NUM_DRUMS; i++) {
|
||||
|
||||
buttons[i].rect = buttonRect;
|
||||
buttons[i].isPressed = 0;
|
||||
buttons[i].upColor = upColor;
|
||||
buttons[i].downColor = downColor;
|
||||
|
||||
buttonRect.y += spacing + buttonRect.h; /* setup y coordinate for next drum */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
loads a wav file (stored in 'file'), converts it to the mixer's output format,
|
||||
and stores the resulting buffer and length in the sound structure
|
||||
*/
|
||||
void
|
||||
loadSound(const char *file, struct sound *s)
|
||||
{
|
||||
SDL_AudioSpec spec; /* the audio format of the .wav file */
|
||||
SDL_AudioCVT cvt; /* used to convert .wav to output format when formats differ */
|
||||
int result;
|
||||
if (SDL_LoadWAV(file, &spec, &s->buffer, &s->length) == NULL) {
|
||||
fatalError("could not load .wav");
|
||||
}
|
||||
/* build the audio converter */
|
||||
result = SDL_BuildAudioCVT(&cvt, spec.format, spec.channels, spec.freq,
|
||||
mixer.outputSpec.format,
|
||||
mixer.outputSpec.channels,
|
||||
mixer.outputSpec.freq);
|
||||
if (result == -1) {
|
||||
fatalError("could not build audio CVT");
|
||||
} else if (result != 0) {
|
||||
/*
|
||||
this happens when the .wav format differs from the output format.
|
||||
we convert the .wav buffer here
|
||||
*/
|
||||
cvt.buf = (Uint8 *) SDL_malloc(s->length * cvt.len_mult); /* allocate conversion buffer */
|
||||
cvt.len = s->length; /* set conversion buffer length */
|
||||
SDL_memcpy(cvt.buf, s->buffer, s->length); /* copy sound to conversion buffer */
|
||||
if (SDL_ConvertAudio(&cvt) == -1) { /* convert the sound */
|
||||
fatalError("could not convert .wav");
|
||||
}
|
||||
SDL_free(s->buffer); /* free the original (unconverted) buffer */
|
||||
s->buffer = cvt.buf; /* point sound buffer to converted buffer */
|
||||
s->length = cvt.len_cvt; /* set sound buffer's new length */
|
||||
}
|
||||
}
|
||||
|
||||
/* called from main event loop */
|
||||
void
|
||||
handleMouseButtonDown(SDL_Event * event)
|
||||
{
|
||||
|
||||
int x, y, mouseIndex, i, drumIndex;
|
||||
|
||||
mouseIndex = 0;
|
||||
drumIndex = -1;
|
||||
|
||||
SDL_GetMouseState(&x, &y);
|
||||
/* check if we hit any of the drum buttons */
|
||||
for (i = 0; i < NUM_DRUMS; i++) {
|
||||
if (x >= buttons[i].rect.x
|
||||
&& x < buttons[i].rect.x + buttons[i].rect.w
|
||||
&& y >= buttons[i].rect.y
|
||||
&& y < buttons[i].rect.y + buttons[i].rect.h) {
|
||||
drumIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (drumIndex != -1) {
|
||||
/* if we hit a button */
|
||||
buttons[drumIndex].touchIndex = mouseIndex;
|
||||
buttons[drumIndex].isPressed = 1;
|
||||
playSound(&drums[drumIndex]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* called from main event loop */
|
||||
void
|
||||
handleMouseButtonUp(SDL_Event * event)
|
||||
{
|
||||
int i;
|
||||
int mouseIndex = 0;
|
||||
/* check if this should cause any of the buttons to become unpressed */
|
||||
for (i = 0; i < NUM_DRUMS; i++) {
|
||||
if (buttons[i].touchIndex == mouseIndex) {
|
||||
buttons[i].isPressed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* draws buttons to screen */
|
||||
void
|
||||
render(SDL_Renderer *renderer)
|
||||
{
|
||||
int i;
|
||||
SDL_SetRenderDrawColor(renderer, 50, 50, 50, 255);
|
||||
SDL_RenderClear(renderer); /* draw background (gray) */
|
||||
/* draw the drum buttons */
|
||||
for (i = 0; i < NUM_DRUMS; i++) {
|
||||
SDL_Color color =
|
||||
buttons[i].isPressed ? buttons[i].downColor : buttons[i].upColor;
|
||||
SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a);
|
||||
SDL_RenderFillRect(renderer, &buttons[i].rect);
|
||||
}
|
||||
/* update the screen */
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
/*
|
||||
finds a sound channel in the mixer for a sound
|
||||
and sets it up to start playing
|
||||
*/
|
||||
int
|
||||
playSound(struct sound *s)
|
||||
{
|
||||
/*
|
||||
find an empty channel to play on.
|
||||
if no channel is available, use oldest channel
|
||||
*/
|
||||
int i;
|
||||
int selected_channel = -1;
|
||||
int oldest_channel = 0;
|
||||
|
||||
if (mixer.numSoundsPlaying == 0) {
|
||||
/* we're playing a sound now, so start audio callback back up */
|
||||
SDL_PauseAudio(0);
|
||||
}
|
||||
|
||||
/* find a sound channel to play the sound on */
|
||||
for (i = 0; i < NUM_CHANNELS; i++) {
|
||||
if (mixer.channels[i].position == NULL) {
|
||||
/* if no sound on this channel, select it */
|
||||
selected_channel = i;
|
||||
break;
|
||||
}
|
||||
/* if this channel's sound is older than the oldest so far, set it to oldest */
|
||||
if (mixer.channels[i].timestamp <
|
||||
mixer.channels[oldest_channel].timestamp)
|
||||
oldest_channel = i;
|
||||
}
|
||||
|
||||
/* no empty channels, take the oldest one */
|
||||
if (selected_channel == -1)
|
||||
selected_channel = oldest_channel;
|
||||
else
|
||||
mixer.numSoundsPlaying++;
|
||||
|
||||
/* point channel data to wav data */
|
||||
mixer.channels[selected_channel].position = s->buffer;
|
||||
mixer.channels[selected_channel].remaining = s->length;
|
||||
mixer.channels[selected_channel].timestamp = SDL_GetTicks();
|
||||
|
||||
return selected_channel;
|
||||
}
|
||||
|
||||
/*
|
||||
Called from SDL's audio system. Supplies sound input with data by mixing together all
|
||||
currently playing sound effects.
|
||||
*/
|
||||
void
|
||||
audioCallback(void *userdata, Uint8 * stream, int len)
|
||||
{
|
||||
int i;
|
||||
int copy_amt;
|
||||
SDL_memset(stream, mixer.outputSpec.silence, len); /* initialize buffer to silence */
|
||||
/* for each channel, mix in whatever is playing on that channel */
|
||||
for (i = 0; i < NUM_CHANNELS; i++) {
|
||||
if (mixer.channels[i].position == NULL) {
|
||||
/* if no sound is playing on this channel */
|
||||
continue; /* nothing to do for this channel */
|
||||
}
|
||||
|
||||
/* copy len bytes to the buffer, unless we have fewer than len bytes remaining */
|
||||
copy_amt =
|
||||
mixer.channels[i].remaining <
|
||||
len ? mixer.channels[i].remaining : len;
|
||||
|
||||
/* mix this sound effect with the output */
|
||||
SDL_MixAudioFormat(stream, mixer.channels[i].position,
|
||||
mixer.outputSpec.format, copy_amt, 150);
|
||||
|
||||
/* update buffer position in sound effect and the number of bytes left */
|
||||
mixer.channels[i].position += copy_amt;
|
||||
mixer.channels[i].remaining -= copy_amt;
|
||||
|
||||
/* did we finish playing the sound effect ? */
|
||||
if (mixer.channels[i].remaining == 0) {
|
||||
mixer.channels[i].position = NULL; /* indicates no sound playing on channel anymore */
|
||||
mixer.numSoundsPlaying--;
|
||||
if (mixer.numSoundsPlaying == 0) {
|
||||
/* if no sounds left playing, pause audio callback */
|
||||
SDL_PauseAudio(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
int done; /* has user tried to quit ? */
|
||||
SDL_Window *window; /* main window */
|
||||
SDL_Renderer *renderer;
|
||||
SDL_Event event;
|
||||
Uint32 startFrame; /* holds when frame started processing */
|
||||
Uint32 endFrame; /* holds when frame ended processing */
|
||||
Uint32 delay; /* calculated delay, how long should we wait before next frame? */
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
|
||||
fatalError("could not initialize SDL");
|
||||
}
|
||||
window =
|
||||
SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS);
|
||||
renderer = SDL_CreateRenderer(window, 0, 0);
|
||||
|
||||
/* initialize the mixer */
|
||||
SDL_memset(&mixer, 0, sizeof(mixer));
|
||||
/* setup output format */
|
||||
mixer.outputSpec.freq = 44100;
|
||||
mixer.outputSpec.format = AUDIO_S16LSB;
|
||||
mixer.outputSpec.channels = 2;
|
||||
mixer.outputSpec.samples = 256;
|
||||
mixer.outputSpec.callback = audioCallback;
|
||||
mixer.outputSpec.userdata = NULL;
|
||||
|
||||
/* open audio for output */
|
||||
if (SDL_OpenAudio(&mixer.outputSpec, NULL) != 0) {
|
||||
fatalError("Opening audio failed");
|
||||
}
|
||||
|
||||
/* load our drum noises */
|
||||
loadSound("ds_kick_big_amb.wav", &drums[3]);
|
||||
loadSound("ds_brush_snare.wav", &drums[2]);
|
||||
loadSound("ds_loose_skin_mute.wav", &drums[1]);
|
||||
loadSound("ds_china.wav", &drums[0]);
|
||||
|
||||
/* setup positions, colors, and state of buttons */
|
||||
initializeButtons();
|
||||
|
||||
/* enter main loop */
|
||||
done = 0;
|
||||
while (!done) {
|
||||
startFrame = SDL_GetTicks();
|
||||
while (SDL_PollEvent(&event)) {
|
||||
switch (event.type) {
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
handleMouseButtonDown(&event);
|
||||
break;
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
handleMouseButtonUp(&event);
|
||||
break;
|
||||
case SDL_QUIT:
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
render(renderer); /* draw buttons */
|
||||
endFrame = SDL_GetTicks();
|
||||
|
||||
/* figure out how much time we have left, and then sleep */
|
||||
delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
|
||||
if (delay < 0) {
|
||||
delay = 0;
|
||||
} else if (delay > MILLESECONDS_PER_FRAME) {
|
||||
delay = MILLESECONDS_PER_FRAME;
|
||||
}
|
||||
SDL_Delay(delay);
|
||||
}
|
||||
|
||||
/* cleanup code, let's free up those sound buffers */
|
||||
int i;
|
||||
for (i = 0; i < NUM_DRUMS; i++) {
|
||||
SDL_free(drums[i].buffer);
|
||||
}
|
||||
/* let SDL do its exit code */
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
81
Engine/lib/sdl/Xcode-iOS/Demos/src/rectangles.c
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* rectangles.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include <time.h>
|
||||
#include "common.h"
|
||||
|
||||
void
|
||||
render(SDL_Renderer *renderer)
|
||||
{
|
||||
|
||||
Uint8 r, g, b;
|
||||
/* Come up with a random rectangle */
|
||||
SDL_Rect rect;
|
||||
rect.w = randomInt(64, 128);
|
||||
rect.h = randomInt(64, 128);
|
||||
rect.x = randomInt(0, SCREEN_WIDTH);
|
||||
rect.y = randomInt(0, SCREEN_HEIGHT);
|
||||
|
||||
/* Come up with a random color */
|
||||
r = randomInt(50, 255);
|
||||
g = randomInt(50, 255);
|
||||
b = randomInt(50, 255);
|
||||
|
||||
/* Fill the rectangle in the color */
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, 255);
|
||||
SDL_RenderFillRect(renderer, &rect);
|
||||
|
||||
/* update screen */
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
if (SDL_Init(SDL_INIT_VIDEO/* | SDL_INIT_AUDIO */) < 0)
|
||||
{
|
||||
printf("Unable to initialize SDL");
|
||||
}
|
||||
|
||||
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
|
||||
int landscape = 1;
|
||||
int modes = SDL_GetNumDisplayModes(0);
|
||||
int sx = 0, sy = 0;
|
||||
for (int i = 0; i < modes; i++)
|
||||
{
|
||||
SDL_DisplayMode mode;
|
||||
SDL_GetDisplayMode(0, i, &mode);
|
||||
if (landscape ? mode.w > sx : mode.h > sy)
|
||||
{
|
||||
sx = mode.w;
|
||||
sy = mode.h;
|
||||
}
|
||||
}
|
||||
|
||||
printf("picked: %d %d\n", sx, sy);
|
||||
|
||||
SDL_Window *_sdl_window = NULL;
|
||||
SDL_GLContext _sdl_context = NULL;
|
||||
|
||||
_sdl_window = SDL_CreateWindow("fred",
|
||||
0, 0,
|
||||
sx, sy,
|
||||
SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS);
|
||||
|
||||
SDL_SetHint("SDL_HINT_ORIENTATIONS", "LandscapeLeft LandscapeRight");
|
||||
|
||||
int ax = 0, ay = 0;
|
||||
SDL_GetWindowSize(_sdl_window, &ax, &ay);
|
||||
|
||||
printf("given: %d %d\n", ax, ay);
|
||||
|
||||
return 0;
|
||||
}
|
||||
125
Engine/lib/sdl/Xcode-iOS/Demos/src/touch.c
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
* touch.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include "math.h"
|
||||
#include "common.h"
|
||||
|
||||
#define BRUSH_SIZE 32 /* width and height of the brush */
|
||||
#define PIXELS_PER_ITERATION 5 /* number of pixels between brush blots when forming a line */
|
||||
|
||||
static SDL_Texture *brush = 0; /* texture for the brush */
|
||||
|
||||
/*
|
||||
draws a line from (startx, starty) to (startx + dx, starty + dy)
|
||||
this is accomplished by drawing several blots spaced PIXELS_PER_ITERATION apart
|
||||
*/
|
||||
void
|
||||
drawLine(SDL_Renderer *renderer, float startx, float starty, float dx, float dy)
|
||||
{
|
||||
|
||||
float distance = sqrt(dx * dx + dy * dy); /* length of line segment (pythagoras) */
|
||||
int iterations = distance / PIXELS_PER_ITERATION + 1; /* number of brush sprites to draw for the line */
|
||||
float dx_prime = dx / iterations; /* x-shift per iteration */
|
||||
float dy_prime = dy / iterations; /* y-shift per iteration */
|
||||
SDL_Rect dstRect; /* rect to draw brush sprite into */
|
||||
|
||||
dstRect.w = BRUSH_SIZE;
|
||||
dstRect.h = BRUSH_SIZE;
|
||||
|
||||
/* setup x and y for the location of the first sprite */
|
||||
float x = startx - BRUSH_SIZE / 2.0f;
|
||||
float y = starty - BRUSH_SIZE / 2.0f;
|
||||
|
||||
int i;
|
||||
/* draw a series of blots to form the line */
|
||||
for (i = 0; i < iterations; i++) {
|
||||
dstRect.x = x;
|
||||
dstRect.y = y;
|
||||
/* shift x and y for next sprite location */
|
||||
x += dx_prime;
|
||||
y += dy_prime;
|
||||
/* draw brush blot */
|
||||
SDL_RenderCopy(renderer, brush, NULL, &dstRect);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
loads the brush texture
|
||||
*/
|
||||
void
|
||||
initializeTexture(SDL_Renderer *renderer)
|
||||
{
|
||||
SDL_Surface *bmp_surface;
|
||||
bmp_surface = SDL_LoadBMP("stroke.bmp");
|
||||
if (bmp_surface == NULL) {
|
||||
fatalError("could not load stroke.bmp");
|
||||
}
|
||||
brush =
|
||||
SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
if (brush == 0) {
|
||||
fatalError("could not create brush texture");
|
||||
}
|
||||
/* additive blending -- laying strokes on top of eachother makes them brighter */
|
||||
SDL_SetTextureBlendMode(brush, SDL_BLENDMODE_ADD);
|
||||
/* set brush color (red) */
|
||||
SDL_SetTextureColorMod(brush, 255, 100, 100);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
int x, y, dx, dy; /* mouse location */
|
||||
Uint8 state; /* mouse (touch) state */
|
||||
SDL_Event event;
|
||||
SDL_Window *window; /* main window */
|
||||
SDL_Renderer *renderer;
|
||||
int done; /* does user want to quit? */
|
||||
|
||||
/* initialize SDL */
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
fatalError("Could not initialize SDL");
|
||||
}
|
||||
|
||||
/* create main window and renderer */
|
||||
window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
SDL_WINDOW_OPENGL |
|
||||
SDL_WINDOW_BORDERLESS);
|
||||
renderer = SDL_CreateRenderer(window, 0, 0);
|
||||
|
||||
/* load brush texture */
|
||||
initializeTexture(renderer);
|
||||
|
||||
/* fill canvass initially with all black */
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderClear(renderer);
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
done = 0;
|
||||
while (!done && SDL_WaitEvent(&event)) {
|
||||
switch (event.type) {
|
||||
case SDL_QUIT:
|
||||
done = 1;
|
||||
break;
|
||||
case SDL_MOUSEMOTION:
|
||||
state = SDL_GetMouseState(&x, &y); /* get its location */
|
||||
SDL_GetRelativeMouseState(&dx, &dy); /* find how much the mouse moved */
|
||||
if (state & SDL_BUTTON_LMASK) { /* is the mouse (touch) down? */
|
||||
drawLine(renderer, x - dx, y - dy, dx, dy); /* draw line segment */
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
SDL_DestroyTexture(brush);
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
1335
Engine/lib/sdl/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
Normal file
|
|
@ -0,0 +1,272 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
AA1EE462176059AB0029C7A5 /* SDL_test_common.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE454176059AB0029C7A5 /* SDL_test_common.c */; };
|
||||
AA1EE463176059AB0029C7A5 /* SDL_test_compare.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */; };
|
||||
AA1EE464176059AB0029C7A5 /* SDL_test_crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */; };
|
||||
AA1EE465176059AB0029C7A5 /* SDL_test_font.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE457176059AB0029C7A5 /* SDL_test_font.c */; };
|
||||
AA1EE466176059AB0029C7A5 /* SDL_test_fuzzer.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */; };
|
||||
AA1EE467176059AB0029C7A5 /* SDL_test_harness.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */; };
|
||||
AA1EE468176059AB0029C7A5 /* SDL_test_imageBlit.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */; };
|
||||
AA1EE469176059AB0029C7A5 /* SDL_test_imageBlitBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */; };
|
||||
AA1EE46A176059AB0029C7A5 /* SDL_test_imageFace.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */; };
|
||||
AA1EE46B176059AB0029C7A5 /* SDL_test_imagePrimitives.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */; };
|
||||
AA1EE46C176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */; };
|
||||
AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */; };
|
||||
AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */; };
|
||||
AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE461176059AB0029C7A5 /* SDL_test_random.c */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
AA1EE4461760589B0029C7A5 /* libSDL2test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2test.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
AA1EE454176059AB0029C7A5 /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = "<group>"; };
|
||||
AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_compare.c; path = ../../src/test/SDL_test_compare.c; sourceTree = "<group>"; };
|
||||
AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_crc32.c; path = ../../src/test/SDL_test_crc32.c; sourceTree = "<group>"; };
|
||||
AA1EE457176059AB0029C7A5 /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_font.c; path = ../../src/test/SDL_test_font.c; sourceTree = "<group>"; };
|
||||
AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_fuzzer.c; path = ../../src/test/SDL_test_fuzzer.c; sourceTree = "<group>"; };
|
||||
AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_harness.c; path = ../../src/test/SDL_test_harness.c; sourceTree = "<group>"; };
|
||||
AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlit.c; path = ../../src/test/SDL_test_imageBlit.c; sourceTree = "<group>"; };
|
||||
AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlitBlend.c; path = ../../src/test/SDL_test_imageBlitBlend.c; sourceTree = "<group>"; };
|
||||
AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageFace.c; path = ../../src/test/SDL_test_imageFace.c; sourceTree = "<group>"; };
|
||||
AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitives.c; path = ../../src/test/SDL_test_imagePrimitives.c; sourceTree = "<group>"; };
|
||||
AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitivesBlend.c; path = ../../src/test/SDL_test_imagePrimitivesBlend.c; sourceTree = "<group>"; };
|
||||
AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = "<group>"; };
|
||||
AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = "<group>"; };
|
||||
AA1EE461176059AB0029C7A5 /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
AA1EE4431760589B0029C7A5 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
AA1EE43D1760589B0029C7A5 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA1EE453176059770029C7A5 /* Library Source */,
|
||||
AA1EE4471760589B0029C7A5 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA1EE4471760589B0029C7A5 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA1EE4461760589B0029C7A5 /* libSDL2test.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA1EE453176059770029C7A5 /* Library Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA1EE454176059AB0029C7A5 /* SDL_test_common.c */,
|
||||
AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */,
|
||||
AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */,
|
||||
AA1EE457176059AB0029C7A5 /* SDL_test_font.c */,
|
||||
AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */,
|
||||
AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */,
|
||||
AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */,
|
||||
AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */,
|
||||
AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */,
|
||||
AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */,
|
||||
AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */,
|
||||
AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */,
|
||||
AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */,
|
||||
AA1EE461176059AB0029C7A5 /* SDL_test_random.c */,
|
||||
);
|
||||
name = "Library Source";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
AA1EE4441760589B0029C7A5 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
AA1EE4451760589B0029C7A5 /* SDL2test */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = AA1EE44A1760589B0029C7A5 /* Build configuration list for PBXNativeTarget "SDL2test" */;
|
||||
buildPhases = (
|
||||
AA1EE4421760589B0029C7A5 /* Sources */,
|
||||
AA1EE4431760589B0029C7A5 /* Frameworks */,
|
||||
AA1EE4441760589B0029C7A5 /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = SDL2test;
|
||||
productName = SDL2test;
|
||||
productReference = AA1EE4461760589B0029C7A5 /* libSDL2test.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
AA1EE43E1760589B0029C7A5 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0460;
|
||||
ORGANIZATIONNAME = "Sam Lantinga";
|
||||
};
|
||||
buildConfigurationList = AA1EE4411760589B0029C7A5 /* Build configuration list for PBXProject "SDL2test" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = AA1EE43D1760589B0029C7A5;
|
||||
productRefGroup = AA1EE4471760589B0029C7A5 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
AA1EE4451760589B0029C7A5 /* SDL2test */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
AA1EE4421760589B0029C7A5 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AA1EE462176059AB0029C7A5 /* SDL_test_common.c in Sources */,
|
||||
AA1EE463176059AB0029C7A5 /* SDL_test_compare.c in Sources */,
|
||||
AA1EE464176059AB0029C7A5 /* SDL_test_crc32.c in Sources */,
|
||||
AA1EE465176059AB0029C7A5 /* SDL_test_font.c in Sources */,
|
||||
AA1EE466176059AB0029C7A5 /* SDL_test_fuzzer.c in Sources */,
|
||||
AA1EE467176059AB0029C7A5 /* SDL_test_harness.c in Sources */,
|
||||
AA1EE468176059AB0029C7A5 /* SDL_test_imageBlit.c in Sources */,
|
||||
AA1EE469176059AB0029C7A5 /* SDL_test_imageBlitBlend.c in Sources */,
|
||||
AA1EE46A176059AB0029C7A5 /* SDL_test_imageFace.c in Sources */,
|
||||
AA1EE46B176059AB0029C7A5 /* SDL_test_imagePrimitives.c in Sources */,
|
||||
AA1EE46C176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c in Sources */,
|
||||
AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */,
|
||||
AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */,
|
||||
AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
AA1EE4481760589B0029C7A5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AA1EE4491760589B0029C7A5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
AA1EE44B1760589B0029C7A5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
HEADER_SEARCH_PATHS = ../../include;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AA1EE44C1760589B0029C7A5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
HEADER_SEARCH_PATHS = ../../include;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
AA1EE4411760589B0029C7A5 /* Build configuration list for PBXProject "SDL2test" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AA1EE4481760589B0029C7A5 /* Debug */,
|
||||
AA1EE4491760589B0029C7A5 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
AA1EE44A1760589B0029C7A5 /* Build configuration list for PBXNativeTarget "SDL2test" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AA1EE44B1760589B0029C7A5 /* Debug */,
|
||||
AA1EE44C1760589B0029C7A5 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = AA1EE43E1760589B0029C7A5 /* Project object */;
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
BIN
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/Icon.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Icon</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>This project builds an SDL based project for iPhone OS using C or Objective-C. It includes everything you need to get up and running with SDL on iPhone.</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Icon.png</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,403 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 45;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0097E2D912F70C4E00724AC5 /* libSDL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0097E2D512F70C4D00724AC5 /* libSDL.a */; };
|
||||
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
|
||||
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
|
||||
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
|
||||
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
|
||||
FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779EDD0E26BA1200F39101 /* CoreAudio.framework */; };
|
||||
FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07C0E26BD8C00F39101 /* Icon.png */; };
|
||||
FD77A07F0E26BDA900F39101 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07E0E26BDA900F39101 /* Default.png */; };
|
||||
FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD77A0840E26BDB800F39101 /* AudioToolbox.framework */; };
|
||||
FD77A09D0E26BDE500F39101 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A09C0E26BDE500F39101 /* main.c */; };
|
||||
FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0097E29A12F70C4D00724AC5 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = "<group>"; };
|
||||
0097E29B12F70C4D00724AC5 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = "<group>"; };
|
||||
0097E29C12F70C4D00724AC5 /* doxyfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = doxyfile; sourceTree = "<group>"; };
|
||||
0097E29D12F70C4D00724AC5 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = "<group>"; };
|
||||
0097E29E12F70C4D00724AC5 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert.h; sourceTree = "<group>"; };
|
||||
0097E29F12F70C4D00724AC5 /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_atomic.h; sourceTree = "<group>"; };
|
||||
0097E2A012F70C4D00724AC5 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio.h; sourceTree = "<group>"; };
|
||||
0097E2A112F70C4D00724AC5 /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendmode.h; sourceTree = "<group>"; };
|
||||
0097E2A212F70C4D00724AC5 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard.h; sourceTree = "<group>"; };
|
||||
0097E2A312F70C4D00724AC5 /* SDL_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_compat.h; sourceTree = "<group>"; };
|
||||
0097E2A412F70C4D00724AC5 /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config.h; sourceTree = "<group>"; };
|
||||
0097E2A512F70C4D00724AC5 /* SDL_config.h.default */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SDL_config.h.default; sourceTree = "<group>"; };
|
||||
0097E2A612F70C4D00724AC5 /* SDL_config.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SDL_config.h.in; sourceTree = "<group>"; };
|
||||
0097E2A712F70C4D00724AC5 /* SDL_config_android.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_android.h; sourceTree = "<group>"; };
|
||||
0097E2A812F70C4D00724AC5 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_iphoneos.h; sourceTree = "<group>"; };
|
||||
0097E2A912F70C4D00724AC5 /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_macosx.h; sourceTree = "<group>"; };
|
||||
0097E2AA12F70C4D00724AC5 /* SDL_config_minimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_minimal.h; sourceTree = "<group>"; };
|
||||
0097E2AC12F70C4D00724AC5 /* SDL_config_pandora.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_pandora.h; sourceTree = "<group>"; };
|
||||
0097E2AD12F70C4D00724AC5 /* SDL_config_windows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_windows.h; sourceTree = "<group>"; };
|
||||
0097E2AE12F70C4D00724AC5 /* SDL_config_wiz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_wiz.h; sourceTree = "<group>"; };
|
||||
0097E2AF12F70C4D00724AC5 /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_copying.h; sourceTree = "<group>"; };
|
||||
0097E2B012F70C4D00724AC5 /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cpuinfo.h; sourceTree = "<group>"; };
|
||||
0097E2B112F70C4D00724AC5 /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_endian.h; sourceTree = "<group>"; };
|
||||
0097E2B212F70C4D00724AC5 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = "<group>"; };
|
||||
0097E2B312F70C4D00724AC5 /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = "<group>"; };
|
||||
0097E2B412F70C4D00724AC5 /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture.h; sourceTree = "<group>"; };
|
||||
0097E2B512F70C4D00724AC5 /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic.h; sourceTree = "<group>"; };
|
||||
0097E2B612F70C4D00724AC5 /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_input.h; sourceTree = "<group>"; };
|
||||
0097E2B712F70C4D00724AC5 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = "<group>"; };
|
||||
0097E2B812F70C4D00724AC5 /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = "<group>"; };
|
||||
0097E2B912F70C4D00724AC5 /* SDL_keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keysym.h; sourceTree = "<group>"; };
|
||||
0097E2BA12F70C4D00724AC5 /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_loadso.h; sourceTree = "<group>"; };
|
||||
0097E2BB12F70C4D00724AC5 /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_main.h; sourceTree = "<group>"; };
|
||||
0097E2BC12F70C4D00724AC5 /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = "<group>"; };
|
||||
0097E2BD12F70C4D00724AC5 /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mutex.h; sourceTree = "<group>"; };
|
||||
0097E2BE12F70C4D00724AC5 /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_name.h; sourceTree = "<group>"; };
|
||||
0097E2BF12F70C4D00724AC5 /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengl.h; sourceTree = "<group>"; };
|
||||
0097E2C012F70C4D00724AC5 /* SDL_opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles.h; sourceTree = "<group>"; };
|
||||
0097E2C112F70C4D00724AC5 /* SDL_pixels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels.h; sourceTree = "<group>"; };
|
||||
0097E2C212F70C4D00724AC5 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_platform.h; sourceTree = "<group>"; };
|
||||
0097E2C312F70C4D00724AC5 /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_power.h; sourceTree = "<group>"; };
|
||||
0097E2C412F70C4D00724AC5 /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_quit.h; sourceTree = "<group>"; };
|
||||
0097E2C512F70C4D00724AC5 /* SDL_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect.h; sourceTree = "<group>"; };
|
||||
0097E2C612F70C4D00724AC5 /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_revision.h; sourceTree = "<group>"; };
|
||||
0097E2C712F70C4D00724AC5 /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwops.h; sourceTree = "<group>"; };
|
||||
0097E2C812F70C4D00724AC5 /* SDL_scalemode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scalemode.h; sourceTree = "<group>"; };
|
||||
0097E2C912F70C4D00724AC5 /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scancode.h; sourceTree = "<group>"; };
|
||||
0097E2CA12F70C4D00724AC5 /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape.h; sourceTree = "<group>"; };
|
||||
0097E2CB12F70C4D00724AC5 /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_stdinc.h; sourceTree = "<group>"; };
|
||||
0097E2CC12F70C4D00724AC5 /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_surface.h; sourceTree = "<group>"; };
|
||||
0097E2CD12F70C4D00724AC5 /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syswm.h; sourceTree = "<group>"; };
|
||||
0097E2CE12F70C4D00724AC5 /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread.h; sourceTree = "<group>"; };
|
||||
0097E2CF12F70C4D00724AC5 /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer.h; sourceTree = "<group>"; };
|
||||
0097E2D012F70C4D00724AC5 /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch.h; sourceTree = "<group>"; };
|
||||
0097E2D112F70C4D00724AC5 /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_types.h; sourceTree = "<group>"; };
|
||||
0097E2D212F70C4D00724AC5 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = "<group>"; };
|
||||
0097E2D312F70C4D00724AC5 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = "<group>"; };
|
||||
0097E2D512F70C4D00724AC5 /* libSDL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSDL.a; sourceTree = "<group>"; };
|
||||
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
||||
28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
FD779EDD0E26BA1200F39101 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
|
||||
FD77A07C0E26BD8C00F39101 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
|
||||
FD77A07E0E26BDA900F39101 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
|
||||
FD77A0840E26BDB800F39101 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
|
||||
FD77A09C0E26BDE500F39101 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
|
||||
FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
|
||||
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
|
||||
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */,
|
||||
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */,
|
||||
FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */,
|
||||
FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */,
|
||||
FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */,
|
||||
0097E2D912F70C4E00724AC5 /* libSDL.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
0097E29812F70C4D00724AC5 /* SDL */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0097E29912F70C4D00724AC5 /* include */,
|
||||
0097E2D412F70C4D00724AC5 /* lib */,
|
||||
);
|
||||
path = SDL;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0097E29912F70C4D00724AC5 /* include */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0097E29A12F70C4D00724AC5 /* begin_code.h */,
|
||||
0097E29B12F70C4D00724AC5 /* close_code.h */,
|
||||
0097E29C12F70C4D00724AC5 /* doxyfile */,
|
||||
0097E29D12F70C4D00724AC5 /* SDL.h */,
|
||||
0097E29E12F70C4D00724AC5 /* SDL_assert.h */,
|
||||
0097E29F12F70C4D00724AC5 /* SDL_atomic.h */,
|
||||
0097E2A012F70C4D00724AC5 /* SDL_audio.h */,
|
||||
0097E2A112F70C4D00724AC5 /* SDL_blendmode.h */,
|
||||
0097E2A212F70C4D00724AC5 /* SDL_clipboard.h */,
|
||||
0097E2A312F70C4D00724AC5 /* SDL_compat.h */,
|
||||
0097E2A412F70C4D00724AC5 /* SDL_config.h */,
|
||||
0097E2A512F70C4D00724AC5 /* SDL_config.h.default */,
|
||||
0097E2A612F70C4D00724AC5 /* SDL_config.h.in */,
|
||||
0097E2A712F70C4D00724AC5 /* SDL_config_android.h */,
|
||||
0097E2A812F70C4D00724AC5 /* SDL_config_iphoneos.h */,
|
||||
0097E2A912F70C4D00724AC5 /* SDL_config_macosx.h */,
|
||||
0097E2AA12F70C4D00724AC5 /* SDL_config_minimal.h */,
|
||||
0097E2AC12F70C4D00724AC5 /* SDL_config_pandora.h */,
|
||||
0097E2AD12F70C4D00724AC5 /* SDL_config_windows.h */,
|
||||
0097E2AE12F70C4D00724AC5 /* SDL_config_wiz.h */,
|
||||
0097E2AF12F70C4D00724AC5 /* SDL_copying.h */,
|
||||
0097E2B012F70C4D00724AC5 /* SDL_cpuinfo.h */,
|
||||
0097E2B112F70C4D00724AC5 /* SDL_endian.h */,
|
||||
0097E2B212F70C4D00724AC5 /* SDL_error.h */,
|
||||
0097E2B312F70C4D00724AC5 /* SDL_events.h */,
|
||||
0097E2B412F70C4D00724AC5 /* SDL_gesture.h */,
|
||||
0097E2B512F70C4D00724AC5 /* SDL_haptic.h */,
|
||||
0097E2B612F70C4D00724AC5 /* SDL_input.h */,
|
||||
0097E2B712F70C4D00724AC5 /* SDL_joystick.h */,
|
||||
0097E2B812F70C4D00724AC5 /* SDL_keyboard.h */,
|
||||
0097E2B912F70C4D00724AC5 /* SDL_keysym.h */,
|
||||
0097E2BA12F70C4D00724AC5 /* SDL_loadso.h */,
|
||||
0097E2BB12F70C4D00724AC5 /* SDL_main.h */,
|
||||
0097E2BC12F70C4D00724AC5 /* SDL_mouse.h */,
|
||||
0097E2BD12F70C4D00724AC5 /* SDL_mutex.h */,
|
||||
0097E2BE12F70C4D00724AC5 /* SDL_name.h */,
|
||||
0097E2BF12F70C4D00724AC5 /* SDL_opengl.h */,
|
||||
0097E2C012F70C4D00724AC5 /* SDL_opengles.h */,
|
||||
0097E2C112F70C4D00724AC5 /* SDL_pixels.h */,
|
||||
0097E2C212F70C4D00724AC5 /* SDL_platform.h */,
|
||||
0097E2C312F70C4D00724AC5 /* SDL_power.h */,
|
||||
0097E2C412F70C4D00724AC5 /* SDL_quit.h */,
|
||||
0097E2C512F70C4D00724AC5 /* SDL_rect.h */,
|
||||
0097E2C612F70C4D00724AC5 /* SDL_revision.h */,
|
||||
0097E2C712F70C4D00724AC5 /* SDL_rwops.h */,
|
||||
0097E2C812F70C4D00724AC5 /* SDL_scalemode.h */,
|
||||
0097E2C912F70C4D00724AC5 /* SDL_scancode.h */,
|
||||
0097E2CA12F70C4D00724AC5 /* SDL_shape.h */,
|
||||
0097E2CB12F70C4D00724AC5 /* SDL_stdinc.h */,
|
||||
0097E2CC12F70C4D00724AC5 /* SDL_surface.h */,
|
||||
0097E2CD12F70C4D00724AC5 /* SDL_syswm.h */,
|
||||
0097E2CE12F70C4D00724AC5 /* SDL_thread.h */,
|
||||
0097E2CF12F70C4D00724AC5 /* SDL_timer.h */,
|
||||
0097E2D012F70C4D00724AC5 /* SDL_touch.h */,
|
||||
0097E2D112F70C4D00724AC5 /* SDL_types.h */,
|
||||
0097E2D212F70C4D00724AC5 /* SDL_version.h */,
|
||||
0097E2D312F70C4D00724AC5 /* SDL_video.h */,
|
||||
);
|
||||
path = include;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0097E2D412F70C4D00724AC5 /* lib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0097E2D512F70C4D00724AC5 /* libSDL.a */,
|
||||
);
|
||||
path = lib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
19C28FACFE9D520D11CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B97315FDCFA39411CA2CEA /* Sources */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
0097E29812F70C4D00724AC5 /* SDL */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
);
|
||||
name = CustomTemplate;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97315FDCFA39411CA2CEA /* Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FD77A09C0E26BDE500F39101 /* main.c */,
|
||||
);
|
||||
name = Sources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FD77A07E0E26BDA900F39101 /* Default.png */,
|
||||
FD77A07C0E26BD8C00F39101 /* Icon.png */,
|
||||
8D1107310486CEB800E47090 /* Info.plist */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */,
|
||||
FD77A0840E26BDB800F39101 /* AudioToolbox.framework */,
|
||||
FD779EDD0E26BA1200F39101 /* CoreAudio.framework */,
|
||||
28FD15070DC6FC5B0079059D /* QuartzCore.framework */,
|
||||
28FD14FF0DC6FC520079059D /* OpenGLES.framework */,
|
||||
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
|
||||
1D30AB110D05D00D00671497 /* Foundation.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
1D6058900D05DD3D006BFB54 /* ___PROJECTNAME___ */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
|
||||
buildPhases = (
|
||||
1D60588D0D05DD3D006BFB54 /* Resources */,
|
||||
1D60588E0D05DD3D006BFB54 /* Sources */,
|
||||
1D60588F0D05DD3D006BFB54 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "___PROJECTNAME___";
|
||||
productName = "___PROJECTNAME___";
|
||||
productReference = 1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
|
||||
compatibilityVersion = "Xcode 3.1";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
English,
|
||||
Japanese,
|
||||
French,
|
||||
German,
|
||||
);
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
1D6058900D05DD3D006BFB54 /* ___PROJECTNAME___ */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
1D60588D0D05DD3D006BFB54 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */,
|
||||
FD77A07F0E26BDA900F39101 /* Default.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
1D60588E0D05DD3D006BFB54 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FD77A09D0E26BDE500F39101 /* main.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1D6058940D05DD3E006BFB54 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/SDL/lib\"",
|
||||
);
|
||||
PRODUCT_NAME = "___PROJECTNAME___";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1D6058950D05DD3E006BFB54 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/SDL/lib\"",
|
||||
);
|
||||
PRODUCT_NAME = "___PROJECTNAME___";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = "";
|
||||
PREBINDING = NO;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
OTHER_CFLAGS = "";
|
||||
PREBINDING = NO;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1D6058940D05DD3E006BFB54 /* Debug */,
|
||||
1D6058950D05DD3E006BFB54 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4F08A954540054247B /* Debug */,
|
||||
C01FCF5008A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
}
|
||||
98
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/main.c
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* rectangles.c
|
||||
* written by Holmes Futrell
|
||||
* use however you want
|
||||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include <time.h>
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 480
|
||||
|
||||
int
|
||||
randomInt(int min, int max)
|
||||
{
|
||||
return min + rand() % (max - min + 1);
|
||||
}
|
||||
|
||||
void
|
||||
render(SDL_Renderer *renderer)
|
||||
{
|
||||
|
||||
Uint8 r, g, b;
|
||||
|
||||
/* Clear the screen */
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
/* Come up with a random rectangle */
|
||||
SDL_Rect rect;
|
||||
rect.w = randomInt(64, 128);
|
||||
rect.h = randomInt(64, 128);
|
||||
rect.x = randomInt(0, SCREEN_WIDTH);
|
||||
rect.y = randomInt(0, SCREEN_HEIGHT);
|
||||
|
||||
/* Come up with a random color */
|
||||
r = randomInt(50, 255);
|
||||
g = randomInt(50, 255);
|
||||
b = randomInt(50, 255);
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, 255);
|
||||
|
||||
/* Fill the rectangle in the color */
|
||||
SDL_RenderFillRect(renderer, &rect);
|
||||
|
||||
/* update screen */
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
SDL_Window *window;
|
||||
SDL_Renderer *renderer;
|
||||
int done;
|
||||
SDL_Event event;
|
||||
|
||||
/* initialize SDL */
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
printf("Could not initialize SDL\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* seed random number generator */
|
||||
srand(time(NULL));
|
||||
|
||||
/* create window and renderer */
|
||||
window =
|
||||
SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
SDL_WINDOW_OPENGL);
|
||||
if (!window) {
|
||||
printf("Could not initialize Window\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
||||
if (!renderer) {
|
||||
printf("Could not create renderer\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Enter render loop, waiting for user to quit */
|
||||
done = 0;
|
||||
while (!done) {
|
||||
while (SDL_PollEvent(&event)) {
|
||||
if (event.type == SDL_QUIT) {
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
render(renderer);
|
||||
SDL_Delay(1);
|
||||
}
|
||||
|
||||
/* shutdown SDL */
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
28
Engine/lib/sdl/Xcode-iOS/Test/Info.plist
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
22
Engine/lib/sdl/Xcode-iOS/Test/README
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
TestiPhoneOS.xcodeproj contains targets to compile many of the SDL test programs for iPhone OS. Most of these test programs work fine, with the following exceptions:
|
||||
|
||||
testalpha:
|
||||
Program crashes. Problem appears to effect Mac OS X as well.
|
||||
|
||||
testthread:
|
||||
SIGTERM kills the process immediately without executing the 'kill' function. The posix standard says this shouldn't happen. Apple seems intent on having iPhone apps exit promptly when the user requests it, so maybe that's why(?)
|
||||
|
||||
testlock:
|
||||
Locks appear to work, but there doesn't appear to be a simple way to send the process SIGINT.
|
||||
|
||||
testpalette:
|
||||
"SDL error: blitting boat: Blit combination not supported." Happens on Mac OS X as well.
|
||||
|
||||
testsprite2:
|
||||
SDL_CreateTextureFromSurface requests an ARGB pixel format, but iPhone's SDL video driver only supports ABGR.
|
||||
|
||||
testwin:
|
||||
Behaves as it does under Mac OS X ... not sure if that is correctly or not.
|
||||
|
||||
threadwin:
|
||||
Works if -threaded is not on. Otherwise it doesn't work, but this is true under Mac OS X as well.
|
||||
2267
Engine/lib/sdl/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
Normal file
28
Engine/lib/sdl/Xcode/SDL/Info-Framework.plist
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>http://www.libsdl.org</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.libsdl.SDL2</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Simple DirectMedia Layer</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.3</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>SDLX</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.0.3</string>
|
||||
</dict>
|
||||
</plist>
|
||||
2955
Engine/lib/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj
Normal file
15
Engine/lib/sdl/Xcode/SDL/pkg-support/SDL.info
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Title SDL 2.0.0
|
||||
Version 1
|
||||
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
||||
DefaultLocation /Library/Frameworks
|
||||
Diskname (null)
|
||||
DeleteWarning
|
||||
NeedsAuthorization NO
|
||||
DisableStop NO
|
||||
UseUserMask NO
|
||||
Application NO
|
||||
Relocatable YES
|
||||
Required NO
|
||||
InstallOnly NO
|
||||
RequiresReboot NO
|
||||
InstallFat NO
|
||||
43
Engine/lib/sdl/Xcode/SDL/pkg-support/codesign-frameworks.sh
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/sh
|
||||
|
||||
# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY!
|
||||
|
||||
# Verify that $CODE_SIGN_IDENTITY is set
|
||||
if [ -z "$CODE_SIGN_IDENTITY" ] ; then
|
||||
echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
|
||||
|
||||
if [ "$CONFIGURATION" = "Release" ] ; then
|
||||
exit 1
|
||||
else
|
||||
# Codesigning is optional for non-release builds.
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
SAVEIFS=$IFS
|
||||
IFS=$(echo -en "\n\b")
|
||||
|
||||
FRAMEWORK_DIR="${TARGET_BUILD_DIR}"
|
||||
|
||||
# Loop through all frameworks
|
||||
FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sed -e "s/\(.*\)/\1\/Versions\/A\//"`
|
||||
RESULT=$?
|
||||
if [[ $RESULT != 0 ]] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Found:"
|
||||
echo "${FRAMEWORKS}"
|
||||
|
||||
for FRAMEWORK in $FRAMEWORKS;
|
||||
do
|
||||
echo "Signing '${FRAMEWORK}'"
|
||||
`codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"`
|
||||
RESULT=$?
|
||||
if [[ $RESULT != 0 ]] ; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# restore $IFS
|
||||
IFS=$SAVEIFS
|
||||
19
Engine/lib/sdl/Xcode/SDL/pkg-support/resources/License.txt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
32
Engine/lib/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
The Simple DirectMedia Layer (SDL for short) is a cross-platform
|
||||
library designed to make it easy to write multi-media software,
|
||||
such as games and emulators.
|
||||
|
||||
The Simple DirectMedia Layer library source code is available from:
|
||||
http://www.libsdl.org/
|
||||
|
||||
This library is distributed under the terms of the zlib license:
|
||||
http://zlib.net/zlib_license.html
|
||||
|
||||
|
||||
This packages contains the SDL framework for OS X.
|
||||
Conforming with Apple guidelines, this framework
|
||||
contains both the SDL runtime component and development header files.
|
||||
|
||||
|
||||
To Install:
|
||||
Copy the SDL2.framework to /Library/Frameworks
|
||||
|
||||
You may alternatively install it in <Your home directory>/Library/Frameworks
|
||||
if your access privileges are not high enough.
|
||||
|
||||
|
||||
Additional References:
|
||||
|
||||
- Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are
|
||||
available at:
|
||||
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips
|
||||
Though these are OpenSceneGraph centric, the same exact concepts apply to
|
||||
SDL, thus the videos are recommended for everybody getting started with
|
||||
developing on Mac OS X. (You can skim over the PlugIns stuff since SDL
|
||||
doesn't have any PlugIns to worry about.)
|
||||
BIN
Engine/lib/sdl/Xcode/SDL/pkg-support/resources/SDL_DS_Store
Normal file
BIN
Engine/lib/sdl/Xcode/SDL/pkg-support/sdl_logo.pdf
Normal file
4780
Engine/lib/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
Normal file
35
Engine/lib/sdl/Xcode/SDLTest/TestDropFile-Info.plist
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.libsdl.test-dropfile</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.6</string>
|
||||
</dict>
|
||||
</plist>
|
||||
1558
Engine/lib/sdl/Xcode/XcodeDocSet/Doxyfile
Normal file
14
Engine/lib/sdl/acinclude/ac_check_define.m4
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
AC_DEFUN([AC_CHECK_DEFINE],[dnl
|
||||
AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
|
||||
AC_EGREP_CPP([YES_IS_DEFINED], [
|
||||
#include <$2>
|
||||
#ifdef $1
|
||||
YES_IS_DEFINED
|
||||
#endif
|
||||
], ac_cv_define_$1=yes, ac_cv_define_$1=no)
|
||||
)
|
||||
if test "$ac_cv_define_$1" = "yes" ; then
|
||||
AC_DEFINE([HAVE_$1],[],[Added by AC_CHECK_DEFINE])
|
||||
fi
|
||||
])dnl
|
||||
AC_DEFINE([HAVE_$1],[],[Added by AC_CHECK_DEFINE])
|
||||
145
Engine/lib/sdl/acinclude/alsa.m4
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
##############################################################################
|
||||
dnl Configure Paths for Alsa
|
||||
dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
|
||||
dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
|
||||
dnl Jaroslav Kysela <perex@suse.cz>
|
||||
dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
|
||||
dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
|
||||
dnl enables arguments --with-alsa-prefix=
|
||||
dnl --with-alsa-enc-prefix=
|
||||
dnl --disable-alsatest
|
||||
dnl
|
||||
dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
|
||||
dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_ALSA],
|
||||
[dnl Save the original CFLAGS, LDFLAGS, and LIBS
|
||||
alsa_save_CFLAGS="$CFLAGS"
|
||||
alsa_save_LDFLAGS="$LDFLAGS"
|
||||
alsa_save_LIBS="$LIBS"
|
||||
alsa_found=yes
|
||||
|
||||
dnl
|
||||
dnl Get the cflags and libraries for alsa
|
||||
dnl
|
||||
AC_ARG_WITH(alsa-prefix,
|
||||
[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)],
|
||||
[alsa_prefix="$withval"], [alsa_prefix=""])
|
||||
|
||||
AC_ARG_WITH(alsa-inc-prefix,
|
||||
[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)],
|
||||
[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
|
||||
|
||||
dnl FIXME: this is not yet implemented
|
||||
AC_ARG_ENABLE(alsatest,
|
||||
[ --disable-alsatest Do not try to compile and run a test Alsa program],
|
||||
[enable_alsatest="$enableval"],
|
||||
[enable_alsatest=yes])
|
||||
|
||||
dnl Add any special include directories
|
||||
AC_MSG_CHECKING(for ALSA CFLAGS)
|
||||
if test "$alsa_inc_prefix" != "" ; then
|
||||
ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
|
||||
CFLAGS="$CFLAGS -I$alsa_inc_prefix"
|
||||
fi
|
||||
AC_MSG_RESULT($ALSA_CFLAGS)
|
||||
|
||||
dnl add any special lib dirs
|
||||
AC_MSG_CHECKING(for ALSA LDFLAGS)
|
||||
if test "$alsa_prefix" != "" ; then
|
||||
ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
|
||||
LDFLAGS="$LDFLAGS $ALSA_LIBS"
|
||||
fi
|
||||
|
||||
dnl add the alsa library
|
||||
ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
|
||||
LIBS=`echo $LIBS | sed 's/-lm//'`
|
||||
LIBS=`echo $LIBS | sed 's/-ldl//'`
|
||||
LIBS=`echo $LIBS | sed 's/-lpthread//'`
|
||||
LIBS=`echo $LIBS | sed 's/ //'`
|
||||
LIBS="$ALSA_LIBS $LIBS"
|
||||
AC_MSG_RESULT($ALSA_LIBS)
|
||||
|
||||
dnl Check for a working version of libasound that is of the right version.
|
||||
min_alsa_version=ifelse([$1], ,0.1.1,$1)
|
||||
AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
|
||||
no_alsa=""
|
||||
alsa_min_major_version=`echo $min_alsa_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
alsa_min_minor_version=`echo $min_alsa_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
alsa_min_micro_version=`echo $min_alsa_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
AC_TRY_COMPILE([
|
||||
#include <alsa/asoundlib.h>
|
||||
], [
|
||||
/* ensure backward compatibility */
|
||||
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
|
||||
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
|
||||
#endif
|
||||
#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
|
||||
#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
|
||||
#endif
|
||||
#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
|
||||
#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
|
||||
#endif
|
||||
|
||||
# if(SND_LIB_MAJOR > $alsa_min_major_version)
|
||||
exit(0);
|
||||
# else
|
||||
# if(SND_LIB_MAJOR < $alsa_min_major_version)
|
||||
# error not present
|
||||
# endif
|
||||
|
||||
# if(SND_LIB_MINOR > $alsa_min_minor_version)
|
||||
exit(0);
|
||||
# else
|
||||
# if(SND_LIB_MINOR < $alsa_min_minor_version)
|
||||
# error not present
|
||||
# endif
|
||||
|
||||
# if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
|
||||
# error not present
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
exit(0);
|
||||
],
|
||||
[AC_MSG_RESULT(found.)],
|
||||
[AC_MSG_RESULT(not present.)
|
||||
ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
|
||||
alsa_found=no]
|
||||
)
|
||||
AC_LANG_RESTORE
|
||||
|
||||
dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
|
||||
if test "x$enable_alsatest" = "xyes"; then
|
||||
AC_CHECK_LIB([asound], [snd_ctl_open],,
|
||||
[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
|
||||
alsa_found=no]
|
||||
)
|
||||
fi
|
||||
|
||||
if test "x$alsa_found" = "xyes" ; then
|
||||
ifelse([$2], , :, [$2])
|
||||
LIBS=`echo $LIBS | sed 's/-lasound//g'`
|
||||
LIBS=`echo $LIBS | sed 's/ //'`
|
||||
LIBS="-lasound $LIBS"
|
||||
fi
|
||||
if test "x$alsa_found" = "xno" ; then
|
||||
ifelse([$3], , :, [$3])
|
||||
CFLAGS="$alsa_save_CFLAGS"
|
||||
LDFLAGS="$alsa_save_LDFLAGS"
|
||||
LIBS="$alsa_save_LIBS"
|
||||
ALSA_CFLAGS=""
|
||||
ALSA_LIBS=""
|
||||
fi
|
||||
|
||||
dnl That should be it. Now just export out symbols:
|
||||
AC_SUBST(ALSA_CFLAGS)
|
||||
AC_SUBST(ALSA_LIBS)
|
||||
])
|
||||
76
Engine/lib/sdl/acinclude/ax_check_compiler_flags.m4
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_check_compiler_flags.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given compiler FLAGS work with the current language's
|
||||
# compiler, or whether they give an error. (Warnings, however, are
|
||||
# ignored.)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2009 Matteo Frigo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 9
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILER_FLAGS],
|
||||
[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
|
||||
AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
|
||||
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
|
||||
AS_LITERAL_IF([$1],
|
||||
[AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [
|
||||
ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$1"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
|
||||
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
|
||||
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])],
|
||||
[ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$1"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
|
||||
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
|
||||
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])
|
||||
eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])
|
||||
AC_MSG_RESULT($ax_check_compiler_flags)
|
||||
if test "x$ax_check_compiler_flags" = xyes; then
|
||||
m4_default([$2], :)
|
||||
else
|
||||
m4_default([$3], :)
|
||||
fi
|
||||
])dnl AX_CHECK_COMPILER_FLAGS
|
||||
215
Engine/lib/sdl/acinclude/ax_gcc_archflag.m4
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro tries to guess the "native" arch corresponding to the target
|
||||
# architecture for use with gcc's -march=arch or -mtune=arch flags. If
|
||||
# found, the cache variable $ax_cv_gcc_archflag is set to this flag and
|
||||
# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is is set to
|
||||
# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is
|
||||
# to add $ax_cv_gcc_archflag to the end of $CFLAGS.
|
||||
#
|
||||
# PORTABLE? should be either [yes] (default) or [no]. In the former case,
|
||||
# the flag is set to -mtune (or equivalent) so that the architecture is
|
||||
# only used for tuning, but the instruction set used is still portable. In
|
||||
# the latter case, the flag is set to -march (or equivalent) so that
|
||||
# architecture-specific instructions are enabled.
|
||||
#
|
||||
# The user can specify --with-gcc-arch=<arch> in order to override the
|
||||
# macro's choice of architecture, or --without-gcc-arch to disable this.
|
||||
#
|
||||
# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is
|
||||
# called unless the user specified --with-gcc-arch manually.
|
||||
#
|
||||
# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_GCC_X86_CPUID
|
||||
#
|
||||
# (The main emphasis here is on recent CPUs, on the principle that doing
|
||||
# high-performance computing on old hardware is uncommon.)
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2008 Matteo Frigo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 8
|
||||
|
||||
AC_DEFUN([AX_GCC_ARCHFLAG],
|
||||
[AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
|
||||
AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])],
|
||||
ax_gcc_arch=$withval, ax_gcc_arch=yes)
|
||||
|
||||
AC_MSG_CHECKING([for gcc architecture flag])
|
||||
AC_MSG_RESULT([])
|
||||
AC_CACHE_VAL(ax_cv_gcc_archflag,
|
||||
[
|
||||
ax_cv_gcc_archflag="unknown"
|
||||
|
||||
if test "$GCC" = yes; then
|
||||
|
||||
if test "x$ax_gcc_arch" = xyes; then
|
||||
ax_gcc_arch=""
|
||||
if test "$cross_compiling" = no; then
|
||||
case $host_cpu in
|
||||
i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones
|
||||
AX_GCC_X86_CPUID(0)
|
||||
AX_GCC_X86_CPUID(1)
|
||||
case $ax_cv_gcc_x86_cpuid_0 in
|
||||
*:756e6547:*:*) # Intel
|
||||
case $ax_cv_gcc_x86_cpuid_1 in
|
||||
*5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;;
|
||||
*5??:*:*:*) ax_gcc_arch=pentium ;;
|
||||
*6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
|
||||
*6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
|
||||
*6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
|
||||
*6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;;
|
||||
*6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
|
||||
*6??:*:*:*) ax_gcc_arch=pentiumpro ;;
|
||||
*f3[[347]]:*:*:*|*f4[1347]:*:*:*)
|
||||
case $host_cpu in
|
||||
x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;;
|
||||
*) ax_gcc_arch="prescott pentium4 pentiumpro" ;;
|
||||
esac ;;
|
||||
*f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";;
|
||||
esac ;;
|
||||
*:68747541:*:*) # AMD
|
||||
case $ax_cv_gcc_x86_cpuid_1 in
|
||||
*5[[67]]?:*:*:*) ax_gcc_arch=k6 ;;
|
||||
*5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;;
|
||||
*5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;;
|
||||
*60?:*:*:*) ax_gcc_arch=k7 ;;
|
||||
*6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;;
|
||||
*6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;;
|
||||
*67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;;
|
||||
*6[[68a]]?:*:*:*)
|
||||
AX_GCC_X86_CPUID(0x80000006) # L2 cache size
|
||||
case $ax_cv_gcc_x86_cpuid_0x80000006 in
|
||||
*:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256
|
||||
ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;;
|
||||
*) ax_gcc_arch="athlon-4 athlon k7" ;;
|
||||
esac ;;
|
||||
*f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;;
|
||||
*f5?:*:*:*) ax_gcc_arch="opteron k8" ;;
|
||||
*f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;;
|
||||
*f??:*:*:*) ax_gcc_arch="k8" ;;
|
||||
esac ;;
|
||||
*:746e6543:*:*) # IDT
|
||||
case $ax_cv_gcc_x86_cpuid_1 in
|
||||
*54?:*:*:*) ax_gcc_arch=winchip-c6 ;;
|
||||
*58?:*:*:*) ax_gcc_arch=winchip2 ;;
|
||||
*6[[78]]?:*:*:*) ax_gcc_arch=c3 ;;
|
||||
*69?:*:*:*) ax_gcc_arch="c3-2 c3" ;;
|
||||
esac ;;
|
||||
esac
|
||||
if test x"$ax_gcc_arch" = x; then # fallback
|
||||
case $host_cpu in
|
||||
i586*) ax_gcc_arch=pentium ;;
|
||||
i686*) ax_gcc_arch=pentiumpro ;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
|
||||
sparc*)
|
||||
AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
|
||||
cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
|
||||
cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
|
||||
case $cputype in
|
||||
*ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
|
||||
*ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
|
||||
*ultrasparc*) ax_gcc_arch="ultrasparc v9" ;;
|
||||
*supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;;
|
||||
*hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;;
|
||||
*cypress*) ax_gcc_arch=cypress ;;
|
||||
esac ;;
|
||||
|
||||
alphaev5) ax_gcc_arch=ev5 ;;
|
||||
alphaev56) ax_gcc_arch=ev56 ;;
|
||||
alphapca56) ax_gcc_arch="pca56 ev56" ;;
|
||||
alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;;
|
||||
alphaev6) ax_gcc_arch=ev6 ;;
|
||||
alphaev67) ax_gcc_arch=ev67 ;;
|
||||
alphaev68) ax_gcc_arch="ev68 ev67" ;;
|
||||
alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;;
|
||||
alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;;
|
||||
alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;;
|
||||
|
||||
powerpc*)
|
||||
cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null`
|
||||
cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'`
|
||||
case $cputype in
|
||||
*750*) ax_gcc_arch="750 G3" ;;
|
||||
*740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;;
|
||||
*74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;;
|
||||
*74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;;
|
||||
*970*) ax_gcc_arch="970 G5 power4";;
|
||||
*POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
|
||||
*POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
|
||||
603ev|8240) ax_gcc_arch="$cputype 603e 603";;
|
||||
*) ax_gcc_arch=$cputype ;;
|
||||
esac
|
||||
ax_gcc_arch="$ax_gcc_arch powerpc"
|
||||
;;
|
||||
esac
|
||||
fi # not cross-compiling
|
||||
fi # guess arch
|
||||
|
||||
if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then
|
||||
for arch in $ax_gcc_arch; do
|
||||
if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code
|
||||
flags="-mtune=$arch"
|
||||
# -mcpu=$arch and m$arch generate nonportable code on every arch except
|
||||
# x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr.
|
||||
case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac
|
||||
else
|
||||
flags="-march=$arch -mcpu=$arch -m$arch"
|
||||
fi
|
||||
for flag in $flags; do
|
||||
AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break])
|
||||
done
|
||||
test "x$ax_cv_gcc_archflag" = xunknown || break
|
||||
done
|
||||
fi
|
||||
|
||||
fi # $GCC=yes
|
||||
])
|
||||
AC_MSG_CHECKING([for gcc architecture flag])
|
||||
AC_MSG_RESULT($ax_cv_gcc_archflag)
|
||||
if test "x$ax_cv_gcc_archflag" = xunknown; then
|
||||
m4_default([$3],:)
|
||||
else
|
||||
m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"])
|
||||
fi
|
||||
])
|
||||
79
Engine/lib/sdl/acinclude/ax_gcc_x86_cpuid.m4.htm
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_GCC_X86_CPUID(OP)
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# On Pentium and later x86 processors, with gcc or a compiler that has a
|
||||
# compatible syntax for inline assembly instructions, run a small program
|
||||
# that executes the cpuid instruction with input OP. This can be used to
|
||||
# detect the CPU type.
|
||||
#
|
||||
# On output, the values of the eax, ebx, ecx, and edx registers are stored
|
||||
# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable
|
||||
# ax_cv_gcc_x86_cpuid_OP.
|
||||
#
|
||||
# If the cpuid instruction fails (because you are running a
|
||||
# cross-compiler, or because you are not using gcc, or because you are on
|
||||
# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP
|
||||
# is set to the string "unknown".
|
||||
#
|
||||
# This macro mainly exists to be used in AX_GCC_ARCHFLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2008 Matteo Frigo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 7
|
||||
|
||||
AC_DEFUN([AX_GCC_X86_CPUID],
|
||||
[AC_REQUIRE([AC_PROG_CC])
|
||||
AC_LANG_PUSH([C])
|
||||
AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
|
||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
|
||||
int op = $1, eax, ebx, ecx, edx;
|
||||
FILE *f;
|
||||
__asm__("cpuid"
|
||||
: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
|
||||
: "a" (op));
|
||||
f = fopen("conftest_cpuid", "w"); if (!f) return 1;
|
||||
fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
|
||||
fclose(f);
|
||||
return 0;
|
||||
])],
|
||||
[ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
|
||||
[ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
|
||||
[ax_cv_gcc_x86_cpuid_$1=unknown])])
|
||||
AC_LANG_POP([C])
|
||||
])
|
||||
168
Engine/lib/sdl/acinclude/esd.m4
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
##############################################################################
|
||||
#
|
||||
# --- esd.m4 ---
|
||||
#
|
||||
# Configure paths for ESD
|
||||
# Manish Singh 98-9-30
|
||||
# stolen back from Frank Belew
|
||||
# stolen from Manish Singh
|
||||
# Shamelessly stolen from Owen Taylor
|
||||
|
||||
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_ESD],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the esd-config script
|
||||
dnl
|
||||
AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
|
||||
esd_prefix="$withval", esd_prefix="")
|
||||
AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
|
||||
esd_exec_prefix="$withval", esd_exec_prefix="")
|
||||
AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
|
||||
, enable_esdtest=yes)
|
||||
|
||||
if test x$esd_exec_prefix != x ; then
|
||||
esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
|
||||
if test x${ESD_CONFIG+set} != xset ; then
|
||||
ESD_CONFIG=$esd_exec_prefix/bin/esd-config
|
||||
fi
|
||||
fi
|
||||
if test x$esd_prefix != x ; then
|
||||
esd_args="$esd_args --prefix=$esd_prefix"
|
||||
if test x${ESD_CONFIG+set} != xset ; then
|
||||
ESD_CONFIG=$esd_prefix/bin/esd-config
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(ESD_CONFIG, esd-config, no)
|
||||
min_esd_version=ifelse([$1], ,0.2.7,$1)
|
||||
AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
|
||||
no_esd=""
|
||||
if test "$ESD_CONFIG" = "no" ; then
|
||||
no_esd=yes
|
||||
else
|
||||
ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
|
||||
ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
|
||||
|
||||
esd_major_version=`$ESD_CONFIG $esd_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
esd_minor_version=`$ESD_CONFIG $esd_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_esdtest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $ESD_CFLAGS"
|
||||
LIBS="$LIBS $ESD_LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed ESD is sufficiently new. (Also sanity
|
||||
dnl checks the results of esd-config to some extent
|
||||
dnl
|
||||
rm -f conf.esdtest
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <esd.h>
|
||||
|
||||
char*
|
||||
my_strdup (char *str)
|
||||
{
|
||||
char *new_str;
|
||||
|
||||
if (str)
|
||||
{
|
||||
new_str = malloc ((strlen (str) + 1) * sizeof(char));
|
||||
strcpy (new_str, str);
|
||||
}
|
||||
else
|
||||
new_str = NULL;
|
||||
|
||||
return new_str;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.esdtest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = my_strdup("$min_esd_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_esd_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (($esd_major_version > major) ||
|
||||
(($esd_major_version == major) && ($esd_minor_version > minor)) ||
|
||||
(($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
|
||||
printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
|
||||
printf("*** best to upgrade to the required version.\n");
|
||||
printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
|
||||
printf("*** to point to the correct copy of esd-config, and remove the file\n");
|
||||
printf("*** config.cache before re-running configure\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_esd" = x ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$ESD_CONFIG" = "no" ; then
|
||||
echo "*** The esd-config script installed by ESD could not be found"
|
||||
echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the ESD_CONFIG environment variable to the"
|
||||
echo "*** full path to esd-config."
|
||||
else
|
||||
if test -f conf.esdtest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run ESD test program, checking why..."
|
||||
CFLAGS="$CFLAGS $ESD_CFLAGS"
|
||||
LIBS="$LIBS $ESD_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include <esd.h>
|
||||
], [ return 0; ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding ESD or finding the wrong"
|
||||
echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means ESD was incorrectly installed"
|
||||
echo "*** or that you have moved ESD since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
ESD_CFLAGS=""
|
||||
ESD_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(ESD_CFLAGS)
|
||||
AC_SUBST(ESD_LIBS)
|
||||
rm -f conf.esdtest
|
||||
])
|
||||
7988
Engine/lib/sdl/acinclude/libtool.m4
vendored
Normal file
384
Engine/lib/sdl/acinclude/ltoptions.m4
vendored
Normal file
|
|
@ -0,0 +1,384 @@
|
|||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7 ltoptions.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
|
||||
|
||||
|
||||
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ------------------------------------------
|
||||
m4_define([_LT_MANGLE_OPTION],
|
||||
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ---------------------------------------
|
||||
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
|
||||
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
|
||||
# saved as a flag.
|
||||
m4_define([_LT_SET_OPTION],
|
||||
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
|
||||
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
[m4_warning([Unknown $1 option `$2'])])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
|
||||
# ------------------------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
m4_define([_LT_IF_OPTION],
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
|
||||
|
||||
|
||||
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
|
||||
# -------------------------------------------------------
|
||||
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
|
||||
# are set.
|
||||
m4_define([_LT_UNLESS_OPTIONS],
|
||||
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
|
||||
[m4_define([$0_found])])])[]dnl
|
||||
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
|
||||
])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
|
||||
# ----------------------------------------
|
||||
# OPTION-LIST is a space-separated list of Libtool options associated
|
||||
# with MACRO-NAME. If any OPTION has a matching handler declared with
|
||||
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
|
||||
# the unknown option and exit.
|
||||
m4_defun([_LT_SET_OPTIONS],
|
||||
[# Set options
|
||||
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[_LT_SET_OPTION([$1], _LT_Option)])
|
||||
|
||||
m4_if([$1],[LT_INIT],[
|
||||
dnl
|
||||
dnl Simply set some default values (i.e off) if boolean options were not
|
||||
dnl specified:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
|
||||
])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
|
||||
])
|
||||
dnl
|
||||
dnl If no reference was made to various pairs of opposing options, then
|
||||
dnl we run the default mode handler for the pair. For example, if neither
|
||||
dnl `shared' nor `disable-shared' was passed, we enable building of shared
|
||||
dnl archives by default:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
])
|
||||
])# _LT_SET_OPTIONS
|
||||
|
||||
|
||||
## --------------------------------- ##
|
||||
## Macros to handle LT_INIT options. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
|
||||
# -----------------------------------------
|
||||
m4_define([_LT_MANGLE_DEFUN],
|
||||
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
|
||||
# -----------------------------------------------
|
||||
m4_define([LT_OPTION_DEFINE],
|
||||
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
|
||||
])# LT_OPTION_DEFINE
|
||||
|
||||
|
||||
# dlopen
|
||||
# ------
|
||||
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_DLOPEN],
|
||||
[_LT_SET_OPTION([LT_INIT], [dlopen])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `dlopen' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
|
||||
|
||||
|
||||
# win32-dll
|
||||
# ---------
|
||||
# Declare package support for building win32 dll's.
|
||||
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
|
||||
[enable_win32_dll=yes
|
||||
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
esac
|
||||
|
||||
test -z "$AS" && AS=as
|
||||
_LT_DECL([], [AS], [1], [Assembler program])dnl
|
||||
|
||||
test -z "$DLLTOOL" && DLLTOOL=dlltool
|
||||
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
|
||||
|
||||
test -z "$OBJDUMP" && OBJDUMP=objdump
|
||||
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
|
||||
])# win32-dll
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
_LT_SET_OPTION([LT_INIT], [win32-dll])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `win32-dll' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
|
||||
|
||||
|
||||
# _LT_ENABLE_SHARED([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-shared flag, and supports the `shared' and
|
||||
# `disable-shared' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_SHARED],
|
||||
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
|
||||
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
|
||||
|
||||
_LT_DECL([build_libtool_libs], [enable_shared], [0],
|
||||
[Whether or not to build shared libraries])
|
||||
])# _LT_ENABLE_SHARED
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-shared])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
|
||||
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_STATIC([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-static flag, and support the `static' and
|
||||
# `disable-static' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_STATIC],
|
||||
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
|
||||
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
|
||||
|
||||
_LT_DECL([build_old_libs], [enable_static], [0],
|
||||
[Whether or not to build static libraries])
|
||||
])# _LT_ENABLE_STATIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-static])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
|
||||
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --enable-fast-install flag, and support the `fast-install'
|
||||
# and `disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_FAST_INSTALL],
|
||||
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
|
||||
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
|
||||
|
||||
_LT_DECL([fast_install], [enable_fast_install], [0],
|
||||
[Whether or not to optimize for fast installation])dnl
|
||||
])# _LT_ENABLE_FAST_INSTALL
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
|
||||
|
||||
# Old names:
|
||||
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `disable-fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
||||
|
||||
|
||||
# _LT_WITH_PIC([MODE])
|
||||
# --------------------
|
||||
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
|
||||
# LT_INIT options.
|
||||
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
||||
m4_define([_LT_WITH_PIC],
|
||||
[AC_ARG_WITH([pic],
|
||||
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
|
||||
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
||||
[lt_p=${PACKAGE-default}
|
||||
case $withval in
|
||||
yes|no) pic_mode=$withval ;;
|
||||
*)
|
||||
pic_mode=default
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for lt_pkg in $withval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$lt_pkg" = "X$lt_p"; then
|
||||
pic_mode=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[pic_mode=default])
|
||||
|
||||
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
||||
|
||||
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
|
||||
])# _LT_WITH_PIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
|
||||
|
||||
# Old name:
|
||||
AU_DEFUN([AC_LIBTOOL_PICMODE],
|
||||
[_LT_SET_OPTION([LT_INIT], [pic-only])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `pic-only' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
|
||||
|
||||
## ----------------- ##
|
||||
## LTDL_INIT Options ##
|
||||
## ----------------- ##
|
||||
|
||||
m4_define([_LTDL_MODE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
|
||||
[m4_define([_LTDL_MODE], [nonrecursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
|
||||
[m4_define([_LTDL_MODE], [recursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
|
||||
[m4_define([_LTDL_MODE], [subproject])])
|
||||
|
||||
m4_define([_LTDL_TYPE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [installable],
|
||||
[m4_define([_LTDL_TYPE], [installable])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
|
||||
[m4_define([_LTDL_TYPE], [convenience])])
|
||||
123
Engine/lib/sdl/acinclude/ltsugar.m4
vendored
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6 ltsugar.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
|
||||
|
||||
|
||||
# lt_join(SEP, ARG1, [ARG2...])
|
||||
# -----------------------------
|
||||
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
|
||||
# associated separator.
|
||||
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
|
||||
# versions in m4sugar had bugs.
|
||||
m4_define([lt_join],
|
||||
[m4_if([$#], [1], [],
|
||||
[$#], [2], [[$2]],
|
||||
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
m4_define([_lt_join],
|
||||
[m4_if([$#$2], [2], [],
|
||||
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
|
||||
|
||||
# lt_car(LIST)
|
||||
# lt_cdr(LIST)
|
||||
# ------------
|
||||
# Manipulate m4 lists.
|
||||
# These macros are necessary as long as will still need to support
|
||||
# Autoconf-2.59 which quotes differently.
|
||||
m4_define([lt_car], [[$1]])
|
||||
m4_define([lt_cdr],
|
||||
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
|
||||
[$#], 1, [],
|
||||
[m4_dquote(m4_shift($@))])])
|
||||
m4_define([lt_unquote], $1)
|
||||
|
||||
|
||||
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# ------------------------------------------
|
||||
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
|
||||
# Note that neither SEPARATOR nor STRING are expanded; they are appended
|
||||
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
|
||||
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
|
||||
# than defined and empty).
|
||||
#
|
||||
# This macro is needed until we can rely on Autoconf 2.62, since earlier
|
||||
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
|
||||
m4_define([lt_append],
|
||||
[m4_define([$1],
|
||||
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
|
||||
|
||||
|
||||
|
||||
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
|
||||
# ----------------------------------------------------------
|
||||
# Produce a SEP delimited list of all paired combinations of elements of
|
||||
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
|
||||
# has the form PREFIXmINFIXSUFFIXn.
|
||||
# Needed until we can rely on m4_combine added in Autoconf 2.62.
|
||||
m4_define([lt_combine],
|
||||
[m4_if(m4_eval([$# > 3]), [1],
|
||||
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
|
||||
[[m4_foreach([_Lt_prefix], [$2],
|
||||
[m4_foreach([_Lt_suffix],
|
||||
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
|
||||
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
|
||||
|
||||
|
||||
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
|
||||
# -----------------------------------------------------------------------
|
||||
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
|
||||
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
|
||||
m4_define([lt_if_append_uniq],
|
||||
[m4_ifdef([$1],
|
||||
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
|
||||
[lt_append([$1], [$2], [$3])$4],
|
||||
[$5])],
|
||||
[lt_append([$1], [$2], [$3])$4])])
|
||||
|
||||
|
||||
# lt_dict_add(DICT, KEY, VALUE)
|
||||
# -----------------------------
|
||||
m4_define([lt_dict_add],
|
||||
[m4_define([$1($2)], [$3])])
|
||||
|
||||
|
||||
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
|
||||
# --------------------------------------------
|
||||
m4_define([lt_dict_add_subkey],
|
||||
[m4_define([$1($2:$3)], [$4])])
|
||||
|
||||
|
||||
# lt_dict_fetch(DICT, KEY, [SUBKEY])
|
||||
# ----------------------------------
|
||||
m4_define([lt_dict_fetch],
|
||||
[m4_ifval([$3],
|
||||
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
|
||||
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
|
||||
|
||||
|
||||
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
|
||||
# -----------------------------------------------------------------
|
||||
m4_define([lt_if_dict_fetch],
|
||||
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
|
||||
[$5],
|
||||
[$6])])
|
||||
|
||||
|
||||
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
|
||||
# --------------------------------------------------------------
|
||||
m4_define([lt_dict_filter],
|
||||
[m4_if([$5], [], [],
|
||||
[lt_join(m4_quote(m4_default([$4], [[, ]])),
|
||||
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
|
||||
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
|
||||
])
|
||||
23
Engine/lib/sdl/acinclude/ltversion.m4
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# @configure_input@
|
||||
|
||||
# serial 3337 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.2])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3337])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4.2'
|
||||
macro_revision='1.3337'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
||||
98
Engine/lib/sdl/acinclude/lt~obsolete.m4
vendored
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5 lt~obsolete.m4
|
||||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
|
||||
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
|
||||
# using a macro with the same name in our local m4/libtool.m4 it'll
|
||||
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
|
||||
# and doesn't know about Autoconf macros at all.)
|
||||
#
|
||||
# So we provide this file, which has a silly filename so it's always
|
||||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
# we give up compatibility with versions before 1.7, at which point
|
||||
# we need to keep only those names which we still refer to.
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
|
||||
|
||||
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
|
||||
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
|
||||
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
|
||||
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
|
||||
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
|
||||
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
|
||||
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
|
||||
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
|
||||
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
|
||||
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
|
||||
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
|
||||
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
|
||||
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
|
||||
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
|
||||
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
|
||||
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
|
||||
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
|
||||
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
|
||||
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
|
||||
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
|
||||
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
|
||||
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
|
||||
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
|
||||
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
|
||||
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
|
||||
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
|
||||
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
|
||||
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
|
||||
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
|
||||
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
|
||||
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
|
||||
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
|
||||
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
|
||||
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
||||
44
Engine/lib/sdl/android-project/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Replace org.libsdl.app with the identifier of your game below, e.g.
|
||||
com.gamemaker.game
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.libsdl.app"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0"
|
||||
android:installLocation="auto">
|
||||
|
||||
<!-- Create a Java class extending SDLActivity and place it in a
|
||||
directory under src matching the package, e.g.
|
||||
src/com/gamemaker/game/MyGame.java
|
||||
|
||||
then replace "SDLActivity" with the name of your class (e.g. "MyGame")
|
||||
in the XML below.
|
||||
|
||||
An example Java class can be found in README-android.txt
|
||||
-->
|
||||
<application android:label="@string/app_name"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:allowBackup="true"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:hardwareAccelerated="true" >
|
||||
<activity android:name="SDLActivity"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
<!-- Android 2.3.3 -->
|
||||
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="12" />
|
||||
|
||||
<!-- OpenGL ES 2.0 -->
|
||||
<uses-feature android:glEsVersion="0x00020000" />
|
||||
|
||||
<!-- Allow writing to external storage -->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
</manifest>
|
||||
17
Engine/lib/sdl/android-project/ant.properties
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# This file is used to override default values used by the Ant build system.
|
||||
#
|
||||
# This file must be checked into Version Control Systems, as it is
|
||||
# integral to the build system of your project.
|
||||
|
||||
# This file is only used by the Ant script.
|
||||
|
||||
# You can use this to override default values such as
|
||||
# 'source.dir' for the location of your java source folder and
|
||||
# 'out.dir' for the location of your output folder.
|
||||
|
||||
# You can also use it define how the release builds are signed by declaring
|
||||
# the following properties:
|
||||
# 'key.store' for the location of your keystore and
|
||||
# 'key.alias' for the name of the key to use.
|
||||
# The password will be asked during the build when you use the 'release' target.
|
||||
|
||||
17
Engine/lib/sdl/android-project/build.properties
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# This file is used to override default values used by the Ant build system.
|
||||
#
|
||||
# This file must be checked in Version Control Systems, as it is
|
||||
# integral to the build system of your project.
|
||||
|
||||
# This file is only used by the Ant script.
|
||||
|
||||
# You can use this to override default values such as
|
||||
# 'source.dir' for the location of your java source folder and
|
||||
# 'out.dir' for the location of your output folder.
|
||||
|
||||
# You can also use it define how the release builds are signed by declaring
|
||||
# the following properties:
|
||||
# 'key.store' for the location of your keystore and
|
||||
# 'key.alias' for the name of the key to use.
|
||||
# The password will be asked during the build when you use the 'release' target.
|
||||
|
||||
93
Engine/lib/sdl/android-project/build.xml
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This should be changed to the name of your project -->
|
||||
<project name="SDLActivity" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
||||