Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
merged with latest sources
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLudwig committed Nov 4, 2012
2 parents 4a1a0a0 + 88c9667 commit a0fea7d
Show file tree
Hide file tree
Showing 66 changed files with 2,624 additions and 534 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Expand Up @@ -60,6 +60,7 @@ HDRS = \
SDL_loadso.h \
SDL_log.h \
SDL_main.h \
SDL_messagebox.h \
SDL_mouse.h \
SDL_mutex.h \
SDL_name.h \
Expand Down
3 changes: 1 addition & 2 deletions README.Platforms
Expand Up @@ -11,13 +11,12 @@ Windows 7
Mac OS X 10.4+
Linux 2.6+
iOS 3.1.3+
Android 1.6+
Android 2.1+

Unofficially supported platforms
================================
(code compiles, but not thoroughly tested)
================================
Windows CE
FreeBSD
NetBSD
OpenBSD
Expand Down
76 changes: 68 additions & 8 deletions README.android
Expand Up @@ -39,18 +39,16 @@ src/main/android/SDL_android_main.cpp

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 this SDL directory into the <project>/jni directory and then copy
SDL_config_android.h to SDL_config.h inside the include folder
3. Place your application source files in the <project>/jni/src directory
4. Edit <project>/jni/src/Android.mk to include your source files
5. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
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.

6. Edit <project>/local.properties to point to the Android SDK directory
7. Run 'ant debug' in android/project. This compiles the .java and eventually
5. Edit <project>/local.properties to point to the Android SDK directory
6. Run 'ant debug' in android/project. This compiles the .java and eventually
creates a .apk with the native code embedded
8. 'ant install' will push the apk to the device or emulator (if connected)
7. 'ant 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:

Expand All @@ -73,6 +71,58 @@ android-project/
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.


================================================================================
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;
import android.os.*;

/*
* A sample wrapper class that just calls SDLActivity
*/

public class MyGame extends SDLActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}

protected void onDestroy() {
super.onDestroy();
}
}
------------------------------------------

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 icon.png files in the
drawable directories under the res directory.

The easiest way to create a set of icons for your project is to remove all
the existing icon.png files, and then use the Eclipse IDE to create a dummy
project. During the process of doing this Eclipse will prompt you to create
an icon. Then just copy the drawable directories it creates over to your
res directory.

You may need to change the name of your icon in AndroidManifest.xml to match
the filename used by Eclipse.

================================================================================
Pause / Resume behaviour
================================================================================
Expand Down Expand Up @@ -105,6 +155,16 @@ 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
================================================================================
Expand Down
8 changes: 8 additions & 0 deletions VisualC/SDL/SDL_VS2008.vcproj
Expand Up @@ -1216,6 +1216,14 @@
RelativePath="..\..\src\video\windows\SDL_windowskeyboard.h"
>
</File>
<File
RelativePath="..\..\src\video\windows\SDL_windowsmessagebox.c"
>
</File>
<File
RelativePath="..\..\src\video\windows\SDL_windowsmessagebox.h"
>
</File>
<File
RelativePath="..\..\src\video\windows\SDL_windowsmodes.c"
>
Expand Down
2 changes: 2 additions & 0 deletions VisualC/SDL/SDL_VS2010.vcxproj
Expand Up @@ -317,6 +317,7 @@
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
Expand Down Expand Up @@ -432,6 +433,7 @@
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
Expand Down
16 changes: 14 additions & 2 deletions Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
Expand Up @@ -156,6 +156,9 @@
AA7558C91595D55500BBD41B /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558961595D55500BBD41B /* SDL_video.h */; };
AA7558CA1595D55500BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558971595D55500BBD41B /* SDL.h */; };
AA9781C91576A7FA00472542 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD6526630DE8FCCB002AD96B /* libSDL2.a */; };
AA9FF9511637C6E5000DF050 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */; };
AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */; };
AABCC3951640643D00AB8930 /* SDL_uikitmessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */; };
FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; };
FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; };
FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A720DEA620800C5B771 /* SDL_malloc.c */; };
Expand Down Expand Up @@ -410,6 +413,9 @@
AA7558951595D55500BBD41B /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = "<group>"; };
AA7558961595D55500BBD41B /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = "<group>"; };
AA7558971595D55500BBD41B /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = "<group>"; };
AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_messagebox.h; sourceTree = "<group>"; };
AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmessagebox.h; sourceTree = "<group>"; };
AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmessagebox.m; sourceTree = "<group>"; };
FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitview.h; sourceTree = "<group>"; };
FD3F4A700DEA620800C5B771 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = "<group>"; };
FD3F4A710DEA620800C5B771 /* SDL_iconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_iconv.c; sourceTree = "<group>"; };
Expand Down Expand Up @@ -853,6 +859,8 @@
FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */,
FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */,
FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */,
AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */,
AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */,
AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */,
AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */,
FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */,
Expand Down Expand Up @@ -894,13 +902,14 @@
children = (
AA7558651595D55500BBD41B /* begin_code.h */,
AA7558661595D55500BBD41B /* close_code.h */,
AA7558971595D55500BBD41B /* SDL.h */,
AA7558671595D55500BBD41B /* SDL_assert.h */,
AA7558681595D55500BBD41B /* SDL_atomic.h */,
AA7558691595D55500BBD41B /* SDL_audio.h */,
AA75586A1595D55500BBD41B /* SDL_blendmode.h */,
AA75586B1595D55500BBD41B /* SDL_clipboard.h */,
AA75586C1595D55500BBD41B /* SDL_config_iphoneos.h */,
AA75586D1595D55500BBD41B /* SDL_config.h */,
AA75586C1595D55500BBD41B /* SDL_config_iphoneos.h */,
AA75586E1595D55500BBD41B /* SDL_copying.h */,
AA75586F1595D55500BBD41B /* SDL_cpuinfo.h */,
AA7558701595D55500BBD41B /* SDL_endian.h */,
Expand All @@ -916,6 +925,7 @@
AA75587A1595D55500BBD41B /* SDL_loadso.h */,
AA75587B1595D55500BBD41B /* SDL_log.h */,
AA75587C1595D55500BBD41B /* SDL_main.h */,
AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */,
AA75587D1595D55500BBD41B /* SDL_mouse.h */,
AA75587E1595D55500BBD41B /* SDL_mutex.h */,
AA75587F1595D55500BBD41B /* SDL_name.h */,
Expand All @@ -942,7 +952,6 @@
AA7558941595D55500BBD41B /* SDL_types.h */,
AA7558951595D55500BBD41B /* SDL_version.h */,
AA7558961595D55500BBD41B /* SDL_video.h */,
AA7558971595D55500BBD41B /* SDL.h */,
);
name = "Public Headers";
path = ../../include;
Expand Down Expand Up @@ -1249,6 +1258,8 @@
AA7558CA1595D55500BBD41B /* SDL.h in Headers */,
AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */,
AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */,
AA9FF9511637C6E5000DF050 /* SDL_messagebox.h in Headers */,
AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1467,6 +1478,7 @@
AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */,
AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */,
AA704DD7162AA90A0076D1C1 /* SDL_dropevents.c in Sources */,
AABCC3951640643D00AB8930 /* SDL_uikitmessagebox.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
8 changes: 3 additions & 5 deletions Xcode/SDL/Info-Framework.plist
Expand Up @@ -4,25 +4,23 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>SDL</string>
<key>CFBundleGetInfoString</key>
<string>http://www.libsdl.org</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>SDL</string>
<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>1.3.0</string>
<string>2.0.0</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>1.3.0</string>
<string>2.0.0</string>
</dict>
</plist>

0 comments on commit a0fea7d

Please sign in to comment.