Android.mk
author Alex Szpakowski <slime73@gmail.com>
Thu, 15 Jan 2015 01:06:14 -0400
branchiOS-improvements
changeset 9532 318042c16b76
parent 9054 18d34edc79ac
child 9592 ba866f4ec675
permissions -rwxr-xr-x
Several improvements to the iOS backend:

- Added new custom launch screen code. It uses the launch screen nib when available on iOS 8+, the launch images dictionary if the launch screen nib isn't available, and the old standard image names if the launch image dictionary isn't in the plist.
The launch screen is now hidden during the first call to SDL_PumpEvents rather than SDL_CreateWindow so apps can have the launch screen still visible if they do time-consuming loading after creating their window. It also fades out in roughly the same way as the system launch screen behavior.
It can be disabled by setting the SDL_IPHONE_LAUNCHSCREEN define in SDL_config_iphoneos.h to 0.

- A blank UIView is now created and displayed when the window is first created. The old behavior was to defer creating any view until SDL_GL_CreateContext, which prevented rotation, touch events, and other windowing-related things from working until then. This also makes it easier to use SDL_GetWindowWMInfo after creating a window.

- Moved the keyboard and animation callback code from SDL's UIView subclasses to its UIViewController subclass, which lets them work properly in all cases when a SDL window is valid, even before SDL_GL_CreateContext is called and after SDL_GL_DeleteContext is called.

- SDL_GL_CreateContext, SDL_GL_SwapWindow, SDL_GL_MakeCurrent, and SDL_GL_DeleteContext are more robust.

- Fixed some edge cases where SDL windows weren't rotating properly or their reported sizes were out of sync with their actual sizes.

- Removed all calls to [UIApplication setStatusBarOrientation:]. It doesn't seem to work as expected in all cases in recent iOS versions.

- Some code style cleanup.
slouken@4964
     1
LOCAL_PATH := $(call my-dir)
slouken@4964
     2
slouken@4964
     3
###########################
slouken@4964
     4
#
slouken@4964
     5
# SDL shared library
slouken@4964
     6
#
slouken@4964
     7
###########################
slouken@4964
     8
slouken@4964
     9
include $(CLEAR_VARS)
slouken@4964
    10
slouken@6270
    11
LOCAL_MODULE := SDL2
slouken@4964
    12
slouken@4964
    13
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
slouken@4964
    14
slouken@7311
    15
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
slouken@7311
    16
slouken@5090
    17
LOCAL_SRC_FILES := \
slouken@4964
    18
	$(subst $(LOCAL_PATH)/,, \
slouken@4964
    19
	$(wildcard $(LOCAL_PATH)/src/*.c) \
slouken@4964
    20
	$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
slouken@5090
    21
	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
slouken@5090
    22
	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
slouken@5003
    23
	$(LOCAL_PATH)/src/atomic/SDL_atomic.c \
slouken@5003
    24
	$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
ewing@7501
    25
	$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
slouken@4964
    26
	$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
icculus@8097
    27
	$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
slouken@4964
    28
	$(wildcard $(LOCAL_PATH)/src/events/*.c) \
slouken@4964
    29
	$(wildcard $(LOCAL_PATH)/src/file/*.c) \
slouken@5090
    30
	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
slouken@5090
    31
	$(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
slouken@4964
    32
	$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
slouken@5090
    33
	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
slouken@5092
    34
	$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
slouken@5090
    35
	$(wildcard $(LOCAL_PATH)/src/power/*.c) \
slouken@6448
    36
	$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
slouken@9054
    37
	$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
slouken@5161
    38
	$(wildcard $(LOCAL_PATH)/src/render/*.c) \
slouken@5204
    39
	$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
slouken@4964
    40
	$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
slouken@4964
    41
	$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
slouken@5090
    42
	$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
slouken@4964
    43
	$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
slouken@5090
    44
	$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
slouken@4964
    45
	$(wildcard $(LOCAL_PATH)/src/video/*.c) \
gabomdq@7793
    46
	$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
gabomdq@7793
    47
    $(wildcard $(LOCAL_PATH)/src/test/*.c))
slouken@4964
    48
slouken@6208
    49
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
gabomdq@7659
    50
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
slouken@4964
    51
slouken@4964
    52
include $(BUILD_SHARED_LIBRARY)
slouken@7804
    53
slouken@7804
    54
###########################
slouken@7804
    55
#
slouken@7804
    56
# SDL static library
slouken@7804
    57
#
slouken@7804
    58
###########################
slouken@7804
    59
slouken@7804
    60
LOCAL_MODULE := SDL2_static
slouken@7804
    61
slouken@7804
    62
LOCAL_MODULE_FILENAME := libSDL2
slouken@7804
    63
slouken@8864
    64
LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,,$(LOCAL_PATH)/src/main/android/SDL_android_main.c)
slouken@7804
    65
slouken@7804
    66
LOCAL_LDLIBS := 
slouken@7804
    67
LOCAL_EXPORT_LDLIBS := -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
slouken@7804
    68
slouken@7804
    69
include $(BUILD_STATIC_LIBRARY)