├── .github └── workflows │ └── build-sdl2-android.yml ├── .gitignore ├── README.md ├── SDL2 ├── CMakeLists.txt ├── build.gradle ├── include │ ├── SDL.h │ ├── SDL_assert.h │ ├── SDL_atomic.h │ ├── SDL_audio.h │ ├── SDL_bits.h │ ├── SDL_blendmode.h │ ├── SDL_clipboard.h │ ├── SDL_config.h │ ├── SDL_config.h.cmake │ ├── SDL_config.h.in │ ├── SDL_config_android.h │ ├── SDL_config_iphoneos.h │ ├── SDL_config_macosx.h │ ├── SDL_config_minimal.h │ ├── SDL_config_pandora.h │ ├── SDL_config_psp.h │ ├── SDL_config_windows.h │ ├── SDL_config_winrt.h │ ├── SDL_config_wiz.h │ ├── SDL_copying.h │ ├── SDL_cpuinfo.h │ ├── SDL_egl.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_opengl_glext.h │ ├── SDL_opengles.h │ ├── SDL_opengles2.h │ ├── SDL_opengles2_gl2.h │ ├── SDL_opengles2_gl2ext.h │ ├── SDL_opengles2_gl2platform.h │ ├── SDL_opengles2_khrplatform.h │ ├── SDL_pixels.h │ ├── SDL_platform.h │ ├── SDL_power.h │ ├── SDL_quit.h │ ├── SDL_rect.h │ ├── SDL_render.h │ ├── SDL_revision.h │ ├── SDL_rwops.h │ ├── SDL_scancode.h │ ├── SDL_shape.h │ ├── SDL_stdinc.h │ ├── SDL_surface.h │ ├── SDL_system.h │ ├── SDL_syswm.h │ ├── SDL_test.h │ ├── SDL_test_assert.h │ ├── SDL_test_common.h │ ├── SDL_test_compare.h │ ├── SDL_test_crc32.h │ ├── SDL_test_font.h │ ├── SDL_test_fuzzer.h │ ├── SDL_test_harness.h │ ├── SDL_test_images.h │ ├── SDL_test_log.h │ ├── SDL_test_md5.h │ ├── SDL_test_random.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 └── src │ ├── SDL.c │ ├── SDL_assert.c │ ├── SDL_assert_c.h │ ├── SDL_error.c │ ├── SDL_error_c.h │ ├── SDL_hints.c │ ├── SDL_internal.h │ ├── SDL_log.c │ ├── atomic │ ├── SDL_atomic.c │ └── SDL_spinlock.c │ ├── audio │ ├── SDL_audio.c │ ├── SDL_audio_c.h │ ├── SDL_audiocvt.c │ ├── SDL_audiodev.c │ ├── SDL_audiodev_c.h │ ├── SDL_audiotypecvt.c │ ├── SDL_mixer.c │ ├── SDL_sysaudio.h │ ├── SDL_wave.c │ ├── SDL_wave.h │ ├── android │ │ ├── SDL_androidaudio.c │ │ └── SDL_androidaudio.h │ ├── dummy │ │ ├── SDL_dummyaudio.c │ │ └── SDL_dummyaudio.h │ ├── paudio │ │ ├── SDL_paudio.c │ │ └── SDL_paudio.h │ └── sdlgenaudiocvt.pl │ ├── core │ └── android │ │ ├── SDL_android.c │ │ └── SDL_android.h │ ├── cpuinfo │ └── SDL_cpuinfo.c │ ├── dynapi │ ├── SDL_dynapi.c │ ├── SDL_dynapi.h │ ├── SDL_dynapi_overrides.h │ ├── SDL_dynapi_procs.h │ └── gendynapi.pl │ ├── events │ ├── SDL_clipboardevents.c │ ├── SDL_clipboardevents_c.h │ ├── SDL_dropevents.c │ ├── SDL_dropevents_c.h │ ├── SDL_events.c │ ├── SDL_events_c.h │ ├── SDL_gesture.c │ ├── SDL_gesture_c.h │ ├── SDL_keyboard.c │ ├── SDL_keyboard_c.h │ ├── SDL_mouse.c │ ├── SDL_mouse_c.h │ ├── SDL_quit.c │ ├── SDL_sysevents.h │ ├── SDL_touch.c │ ├── SDL_touch_c.h │ ├── SDL_windowevents.c │ ├── SDL_windowevents_c.h │ ├── blank_cursor.h │ ├── default_cursor.h │ ├── scancodes_darwin.h │ ├── scancodes_linux.h │ ├── scancodes_windows.h │ └── scancodes_xfree86.h │ ├── file │ └── SDL_rwops.c │ ├── filesystem │ └── android │ │ └── SDL_sysfilesystem.c │ ├── haptic │ ├── SDL_haptic.c │ ├── SDL_haptic_c.h │ ├── SDL_syshaptic.h │ └── dummy │ │ └── SDL_syshaptic.c │ ├── joystick │ ├── SDL_gamecontroller.c │ ├── SDL_gamecontrollerdb.h │ ├── SDL_joystick.c │ ├── SDL_joystick_c.h │ ├── SDL_sysjoystick.h │ ├── android │ │ ├── SDL_sysjoystick.c │ │ └── SDL_sysjoystick_c.h │ └── sort_controllers.py │ ├── libm │ ├── e_atan2.c │ ├── e_log.c │ ├── e_pow.c │ ├── e_rem_pio2.c │ ├── e_sqrt.c │ ├── k_cos.c │ ├── k_rem_pio2.c │ ├── k_sin.c │ ├── k_tan.c │ ├── math_libm.h │ ├── math_private.h │ ├── s_atan.c │ ├── s_copysign.c │ ├── s_cos.c │ ├── s_fabs.c │ ├── s_floor.c │ ├── s_scalbn.c │ ├── s_sin.c │ └── s_tan.c │ ├── loadso │ └── dlopen │ │ └── SDL_sysloadso.c │ ├── power │ ├── SDL_power.c │ └── android │ │ └── SDL_syspower.c │ ├── render │ ├── SDL_d3dmath.c │ ├── SDL_d3dmath.h │ ├── SDL_render.c │ ├── SDL_sysrender.h │ ├── SDL_yuv_mmx.c │ ├── SDL_yuv_sw.c │ ├── SDL_yuv_sw_c.h │ ├── mmx.h │ ├── opengl │ │ ├── SDL_glfuncs.h │ │ ├── SDL_render_gl.c │ │ ├── SDL_shaders_gl.c │ │ └── SDL_shaders_gl.h │ ├── opengles │ │ ├── SDL_glesfuncs.h │ │ └── SDL_render_gles.c │ ├── opengles2 │ │ ├── SDL_gles2funcs.h │ │ ├── SDL_render_gles2.c │ │ ├── SDL_shaders_gles2.c │ │ └── SDL_shaders_gles2.h │ ├── psp │ │ └── SDL_render_psp.c │ └── software │ │ ├── SDL_blendfillrect.c │ │ ├── SDL_blendfillrect.h │ │ ├── SDL_blendline.c │ │ ├── SDL_blendline.h │ │ ├── SDL_blendpoint.c │ │ ├── SDL_blendpoint.h │ │ ├── SDL_draw.h │ │ ├── SDL_drawline.c │ │ ├── SDL_drawline.h │ │ ├── SDL_drawpoint.c │ │ ├── SDL_drawpoint.h │ │ ├── SDL_render_sw.c │ │ ├── SDL_render_sw_c.h │ │ ├── SDL_rotate.c │ │ └── SDL_rotate.h │ ├── stdlib │ ├── SDL_getenv.c │ ├── SDL_iconv.c │ ├── SDL_malloc.c │ ├── SDL_qsort.c │ ├── SDL_stdlib.c │ └── SDL_string.c │ ├── test │ ├── SDL_test_assert.c │ ├── SDL_test_common.c │ ├── SDL_test_compare.c │ ├── SDL_test_crc32.c │ ├── SDL_test_font.c │ ├── SDL_test_fuzzer.c │ ├── SDL_test_harness.c │ ├── SDL_test_imageBlit.c │ ├── SDL_test_imageBlitBlend.c │ ├── SDL_test_imageFace.c │ ├── SDL_test_imagePrimitives.c │ ├── SDL_test_imagePrimitivesBlend.c │ ├── SDL_test_log.c │ ├── SDL_test_md5.c │ └── SDL_test_random.c │ ├── thread │ ├── SDL_systhread.h │ ├── SDL_thread.c │ ├── SDL_thread_c.h │ └── pthread │ │ ├── SDL_syscond.c │ │ ├── SDL_sysmutex.c │ │ ├── SDL_sysmutex_c.h │ │ ├── SDL_syssem.c │ │ ├── SDL_systhread.c │ │ ├── SDL_systhread_c.h │ │ └── SDL_systls.c │ ├── timer │ ├── SDL_timer.c │ ├── SDL_timer_c.h │ └── unix │ │ └── SDL_systimer.c │ └── video │ ├── SDL_RLEaccel.c │ ├── SDL_RLEaccel_c.h │ ├── SDL_blit.c │ ├── SDL_blit.h │ ├── SDL_blit_0.c │ ├── SDL_blit_1.c │ ├── SDL_blit_A.c │ ├── SDL_blit_N.c │ ├── SDL_blit_auto.c │ ├── SDL_blit_auto.h │ ├── SDL_blit_copy.c │ ├── SDL_blit_copy.h │ ├── SDL_blit_slow.c │ ├── SDL_blit_slow.h │ ├── SDL_bmp.c │ ├── SDL_clipboard.c │ ├── SDL_egl.c │ ├── SDL_egl_c.h │ ├── SDL_fillrect.c │ ├── SDL_pixels.c │ ├── SDL_pixels_c.h │ ├── SDL_rect.c │ ├── SDL_rect_c.h │ ├── SDL_shape.c │ ├── SDL_shape_internals.h │ ├── SDL_stretch.c │ ├── SDL_surface.c │ ├── SDL_sysvideo.h │ ├── SDL_video.c │ ├── android │ ├── SDL_androidclipboard.c │ ├── SDL_androidclipboard.h │ ├── SDL_androidevents.c │ ├── SDL_androidevents.h │ ├── SDL_androidgl.c │ ├── SDL_androidkeyboard.c │ ├── SDL_androidkeyboard.h │ ├── SDL_androidmessagebox.c │ ├── SDL_androidmessagebox.h │ ├── SDL_androidmouse.c │ ├── SDL_androidmouse.h │ ├── SDL_androidtouch.c │ ├── SDL_androidtouch.h │ ├── SDL_androidvideo.c │ ├── SDL_androidvideo.h │ ├── SDL_androidwindow.c │ └── SDL_androidwindow.h │ └── sdlgenblit.pl ├── SDL2_gfx ├── CMakeLists.txt ├── build.gradle ├── include │ ├── SDL2_framerate.h │ ├── SDL2_gfxPrimitives.h │ ├── SDL2_gfxPrimitives_font.h │ ├── SDL2_imageFilter.h │ └── SDL2_rotozoom.h └── src │ ├── SDL2_framerate.c │ ├── SDL2_gfxPrimitives.c │ ├── SDL2_imageFilter.c │ └── SDL2_rotozoom.c ├── SDL2_image ├── CMakeLists.txt ├── build.gradle ├── include │ ├── SDL_image.h │ └── miniz.h └── src │ ├── IMG.c │ ├── IMG_bmp.c │ ├── IMG_gif.c │ ├── IMG_jpg.c │ ├── IMG_lbm.c │ ├── IMG_pcx.c │ ├── IMG_png.c │ ├── IMG_pnm.c │ ├── IMG_tga.c │ ├── IMG_tif.c │ ├── IMG_webp.c │ ├── IMG_xcf.c │ ├── IMG_xpm.c │ ├── IMG_xv.c │ ├── IMG_xxx.c │ └── showimage.c ├── SDL2_jpeg ├── CMakeLists.txt ├── build.gradle ├── include │ ├── cderror.h │ ├── cdjpeg.h │ ├── jconfig.h │ ├── jdct.h │ ├── jerror.h │ ├── jinclude.h │ ├── jmemsys.h │ ├── jmorecfg.h │ ├── jpegint.h │ ├── jpeglib.h │ ├── jversion.h │ └── transupp.h └── src │ ├── cdjpeg.c │ ├── cjpeg.c │ ├── ckconfig.c │ ├── djpeg.c │ ├── example.c │ ├── jaricom.c │ ├── jcapimin.c │ ├── jcapistd.c │ ├── jcarith.c │ ├── jccoefct.c │ ├── jccolor.c │ ├── jcdctmgr.c │ ├── jchuff.c │ ├── jcinit.c │ ├── jcmainct.c │ ├── jcmarker.c │ ├── jcmaster.c │ ├── jcomapi.c │ ├── jcparam.c │ ├── jcprepct.c │ ├── jcsample.c │ ├── jctrans.c │ ├── jdapimin.c │ ├── jdapistd.c │ ├── jdarith.c │ ├── jdatadst.c │ ├── jdatasrc.c │ ├── jdcoefct.c │ ├── jdcolor.c │ ├── jddctmgr.c │ ├── jdhuff.c │ ├── jdinput.c │ ├── jdmainct.c │ ├── jdmarker.c │ ├── jdmaster.c │ ├── jdmerge.c │ ├── jdpostct.c │ ├── jdsample.c │ ├── jdtrans.c │ ├── jerror.c │ ├── jfdctflt.c │ ├── jfdctfst.c │ ├── jfdctint.c │ ├── jidctflt.c │ ├── jidctfst.c │ ├── jidctint.c │ ├── jmem-android.c │ ├── jmemansi.c │ ├── jmemdos.c │ ├── jmemmac.c │ ├── jmemmgr.c │ ├── jmemname.c │ ├── jmemnobs.c │ ├── jpegtran.c │ ├── jquant1.c │ ├── jquant2.c │ ├── jutils.c │ ├── rdbmp.c │ ├── rdcolmap.c │ ├── rdgif.c │ ├── rdjpgcom.c │ ├── rdppm.c │ ├── rdrle.c │ ├── rdswitch.c │ ├── rdtarga.c │ ├── transupp.c │ ├── wrbmp.c │ ├── wrgif.c │ ├── wrjpgcom.c │ ├── wrppm.c │ ├── wrrle.c │ └── wrtarga.c ├── SDL2_mixer ├── CMakeLists.txt ├── build.gradle ├── include │ ├── SDL_mixer.h │ ├── dynamic_flac.h │ ├── dynamic_fluidsynth.h │ ├── dynamic_mod.h │ ├── dynamic_modplug.h │ ├── dynamic_mp3.h │ ├── dynamic_ogg.h │ ├── effects_internal.h │ ├── fluidsynth.h │ ├── load_aiff.h │ ├── load_flac.h │ ├── load_mp3.h │ ├── load_ogg.h │ ├── load_voc.h │ ├── music_cmd.h │ ├── music_flac.h │ ├── music_mad.h │ ├── music_mod.h │ ├── music_modplug.h │ ├── music_ogg.h │ └── wavestream.h └── src │ ├── dynamic_flac.c │ ├── dynamic_fluidsynth.c │ ├── dynamic_mod.c │ ├── dynamic_modplug.c │ ├── dynamic_mp3.c │ ├── dynamic_ogg.c │ ├── effect_position.c │ ├── effect_stereoreverse.c │ ├── effects_internal.c │ ├── fluidsynth.c │ ├── load_aiff.c │ ├── load_flac.c │ ├── load_mp3.c │ ├── load_ogg.c │ ├── load_voc.c │ ├── mixer.c │ ├── music.c │ ├── music_cmd.c │ ├── music_flac.c │ ├── music_mad.c │ ├── music_mod.c │ ├── music_modplug.c │ ├── music_ogg.c │ ├── playmus.c │ ├── playwave.c │ └── wavestream.c ├── SDL2_png ├── CMakeLists.txt ├── build.gradle ├── include │ ├── config.h │ ├── png.h │ ├── pngconf.h │ ├── pngdebug.h │ ├── pnginfo.h │ ├── pnglibconf.h │ ├── pngprefix.h │ ├── pngpriv.h │ └── pngstruct.h └── src │ ├── png.c │ ├── pngerror.c │ ├── pngget.c │ ├── pngmem.c │ ├── pngpread.c │ ├── pngread.c │ ├── pngrio.c │ ├── pngrtran.c │ ├── pngrutil.c │ ├── pngset.c │ ├── pngtest.c │ ├── pngtrans.c │ ├── pngwio.c │ ├── pngwrite.c │ ├── pngwtran.c │ └── pngwutil.c ├── SDL2_ttf ├── CMakeLists.txt ├── build.gradle ├── include │ └── SDL_ttf.h └── src │ ├── SDL_ttf.c │ ├── glfont.c │ └── showfont.c ├── app ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── blazed.ttf │ ├── brno-snow.jpg │ ├── cuckoo.wav │ └── smiley.png │ ├── java │ └── rocks │ │ └── georgik │ │ └── sdlapp │ │ ├── MainActivity.java │ │ └── SDLActivity.java │ └── res │ ├── layout │ └── activity_main.xml │ └── values │ ├── colors.xml │ └── strings.xml ├── build.gradle ├── freetype ├── CMakeLists.txt ├── build.gradle ├── include │ ├── freetype │ │ ├── config │ │ │ ├── ftconfig.h │ │ │ ├── ftheader.h │ │ │ ├── ftmodule.h │ │ │ ├── ftoption.h │ │ │ └── ftstdlib.h │ │ ├── freetype.h │ │ ├── ftadvanc.h │ │ ├── ftautoh.h │ │ ├── ftbbox.h │ │ ├── ftbdf.h │ │ ├── ftbitmap.h │ │ ├── ftbzip2.h │ │ ├── ftcache.h │ │ ├── ftcffdrv.h │ │ ├── ftchapters.h │ │ ├── ftcid.h │ │ ├── fterrdef.h │ │ ├── fterrors.h │ │ ├── ftgasp.h │ │ ├── ftglyph.h │ │ ├── ftgxval.h │ │ ├── ftgzip.h │ │ ├── ftimage.h │ │ ├── ftincrem.h │ │ ├── ftlcdfil.h │ │ ├── ftlist.h │ │ ├── ftlzw.h │ │ ├── ftmac.h │ │ ├── ftmm.h │ │ ├── ftmodapi.h │ │ ├── ftmoderr.h │ │ ├── ftotval.h │ │ ├── ftoutln.h │ │ ├── ftpfr.h │ │ ├── ftrender.h │ │ ├── ftsizes.h │ │ ├── ftsnames.h │ │ ├── ftstroke.h │ │ ├── ftsynth.h │ │ ├── ftsystem.h │ │ ├── fttrigon.h │ │ ├── fttypes.h │ │ ├── ftwinfnt.h │ │ ├── ftxf86.h │ │ ├── internal │ │ │ ├── autohint.h │ │ │ ├── ftcalc.h │ │ │ ├── ftdebug.h │ │ │ ├── ftdriver.h │ │ │ ├── ftgloadr.h │ │ │ ├── ftmemory.h │ │ │ ├── ftobjs.h │ │ │ ├── ftpic.h │ │ │ ├── ftrfork.h │ │ │ ├── ftserv.h │ │ │ ├── ftstream.h │ │ │ ├── fttrace.h │ │ │ ├── ftvalid.h │ │ │ ├── internal.h │ │ │ ├── psaux.h │ │ │ ├── pshints.h │ │ │ ├── services │ │ │ │ ├── svbdf.h │ │ │ │ ├── svcid.h │ │ │ │ ├── svgldict.h │ │ │ │ ├── svgxval.h │ │ │ │ ├── svkern.h │ │ │ │ ├── svmm.h │ │ │ │ ├── svotval.h │ │ │ │ ├── svpfr.h │ │ │ │ ├── svpostnm.h │ │ │ │ ├── svprop.h │ │ │ │ ├── svpscmap.h │ │ │ │ ├── svpsinfo.h │ │ │ │ ├── svsfnt.h │ │ │ │ ├── svttcmap.h │ │ │ │ ├── svtteng.h │ │ │ │ ├── svttglyf.h │ │ │ │ ├── svwinfnt.h │ │ │ │ └── svxf86nm.h │ │ │ ├── sfnt.h │ │ │ ├── t1types.h │ │ │ └── tttypes.h │ │ ├── t1tables.h │ │ ├── ttnameid.h │ │ ├── tttables.h │ │ ├── tttags.h │ │ └── ttunpat.h │ ├── ft2build.h │ ├── ftconfig.h │ └── ftmodule.h └── src │ ├── Jamfile │ ├── autofit │ ├── Jamfile │ ├── afangles.c │ ├── afangles.h │ ├── afcjk.c │ ├── afcjk.h │ ├── afdummy.c │ ├── afdummy.h │ ├── aferrors.h │ ├── afglobal.c │ ├── afglobal.h │ ├── afhints.c │ ├── afhints.h │ ├── afindic.c │ ├── afindic.h │ ├── aflatin.c │ ├── aflatin.h │ ├── aflatin2.c │ ├── aflatin2.h │ ├── afloader.c │ ├── afloader.h │ ├── afmodule.c │ ├── afmodule.h │ ├── afpic.c │ ├── afpic.h │ ├── aftypes.h │ ├── afwarp.c │ ├── afwarp.h │ ├── autofit.c │ ├── module.mk │ └── rules.mk │ ├── base │ ├── Jamfile │ ├── basepic.c │ ├── basepic.h │ ├── ftadvanc.c │ ├── ftapi.c │ ├── ftbase.c │ ├── ftbase.h │ ├── ftbbox.c │ ├── ftbdf.c │ ├── ftbitmap.c │ ├── ftcalc.c │ ├── ftcid.c │ ├── ftdbgmem.c │ ├── ftdebug.c │ ├── ftfstype.c │ ├── ftgasp.c │ ├── ftgloadr.c │ ├── ftglyph.c │ ├── ftgxval.c │ ├── ftinit.c │ ├── ftlcdfil.c │ ├── ftmac.c │ ├── ftmm.c │ ├── ftobjs.c │ ├── ftotval.c │ ├── ftoutln.c │ ├── ftpatent.c │ ├── ftpfr.c │ ├── ftpic.c │ ├── ftrfork.c │ ├── ftsnames.c │ ├── ftstream.c │ ├── ftstroke.c │ ├── ftsynth.c │ ├── ftsystem.c │ ├── fttrigon.c │ ├── fttype1.c │ ├── ftutil.c │ ├── ftwinfnt.c │ ├── ftxf86.c │ ├── md5.c │ ├── md5.h │ └── rules.mk │ ├── bdf │ ├── Jamfile │ ├── README │ ├── bdf.c │ ├── bdf.h │ ├── bdfdrivr.c │ ├── bdfdrivr.h │ ├── bdferror.h │ ├── bdflib.c │ ├── module.mk │ └── rules.mk │ ├── bzip2 │ ├── Jamfile │ ├── ftbzip2.c │ └── rules.mk │ ├── cache │ ├── Jamfile │ ├── ftcache.c │ ├── ftcbasic.c │ ├── ftccache.c │ ├── ftccache.h │ ├── ftccback.h │ ├── ftccmap.c │ ├── ftcerror.h │ ├── ftcglyph.c │ ├── ftcglyph.h │ ├── ftcimage.c │ ├── ftcimage.h │ ├── ftcmanag.c │ ├── ftcmanag.h │ ├── ftcmru.c │ ├── ftcmru.h │ ├── ftcsbits.c │ ├── ftcsbits.h │ └── rules.mk │ ├── cff │ ├── Jamfile │ ├── cf2arrst.c │ ├── cf2arrst.h │ ├── cf2blues.c │ ├── cf2blues.h │ ├── cf2error.c │ ├── cf2error.h │ ├── cf2fixed.h │ ├── cf2font.c │ ├── cf2font.h │ ├── cf2ft.c │ ├── cf2ft.h │ ├── cf2glue.h │ ├── cf2hints.c │ ├── cf2hints.h │ ├── cf2intrp.c │ ├── cf2intrp.h │ ├── cf2read.c │ ├── cf2read.h │ ├── cf2stack.c │ ├── cf2stack.h │ ├── cf2types.h │ ├── cff.c │ ├── cffcmap.c │ ├── cffcmap.h │ ├── cffdrivr.c │ ├── cffdrivr.h │ ├── cfferrs.h │ ├── cffgload.c │ ├── cffgload.h │ ├── cffload.c │ ├── cffload.h │ ├── cffobjs.c │ ├── cffobjs.h │ ├── cffparse.c │ ├── cffparse.h │ ├── cffpic.c │ ├── cffpic.h │ ├── cfftoken.h │ ├── cfftypes.h │ ├── module.mk │ └── rules.mk │ ├── cid │ ├── Jamfile │ ├── ciderrs.h │ ├── cidgload.c │ ├── cidgload.h │ ├── cidload.c │ ├── cidload.h │ ├── cidobjs.c │ ├── cidobjs.h │ ├── cidparse.c │ ├── cidparse.h │ ├── cidriver.c │ ├── cidriver.h │ ├── cidtoken.h │ ├── module.mk │ ├── rules.mk │ └── type1cid.c │ ├── gxvalid │ ├── Jamfile │ ├── README │ ├── gxvalid.c │ ├── gxvalid.h │ ├── gxvbsln.c │ ├── gxvcommn.c │ ├── gxvcommn.h │ ├── gxverror.h │ ├── gxvfeat.c │ ├── gxvfeat.h │ ├── gxvfgen.c │ ├── gxvjust.c │ ├── gxvkern.c │ ├── gxvlcar.c │ ├── gxvmod.c │ ├── gxvmod.h │ ├── gxvmort.c │ ├── gxvmort.h │ ├── gxvmort0.c │ ├── gxvmort1.c │ ├── gxvmort2.c │ ├── gxvmort4.c │ ├── gxvmort5.c │ ├── gxvmorx.c │ ├── gxvmorx.h │ ├── gxvmorx0.c │ ├── gxvmorx1.c │ ├── gxvmorx2.c │ ├── gxvmorx4.c │ ├── gxvmorx5.c │ ├── gxvopbd.c │ ├── gxvprop.c │ ├── gxvtrak.c │ ├── module.mk │ └── rules.mk │ ├── gzip │ ├── Jamfile │ ├── adler32.c │ ├── ftgzip.c │ ├── infblock.c │ ├── infblock.h │ ├── infcodes.c │ ├── infcodes.h │ ├── inffixed.h │ ├── inflate.c │ ├── inftrees.c │ ├── inftrees.h │ ├── infutil.c │ ├── infutil.h │ ├── rules.mk │ ├── zconf.h │ ├── zlib.h │ ├── zutil.c │ └── zutil.h │ ├── lzw │ ├── Jamfile │ ├── ftlzw.c │ ├── ftzopen.c │ ├── ftzopen.h │ └── rules.mk │ ├── otvalid │ ├── Jamfile │ ├── module.mk │ ├── otvalid.c │ ├── otvalid.h │ ├── otvbase.c │ ├── otvcommn.c │ ├── otvcommn.h │ ├── otverror.h │ ├── otvgdef.c │ ├── otvgpos.c │ ├── otvgpos.h │ ├── otvgsub.c │ ├── otvjstf.c │ ├── otvmath.c │ ├── otvmod.c │ ├── otvmod.h │ └── rules.mk │ ├── pcf │ ├── Jamfile │ ├── README │ ├── module.mk │ ├── pcf.c │ ├── pcf.h │ ├── pcfdrivr.c │ ├── pcfdrivr.h │ ├── pcferror.h │ ├── pcfread.c │ ├── pcfread.h │ ├── pcfutil.c │ ├── pcfutil.h │ └── rules.mk │ ├── pfr │ ├── Jamfile │ ├── module.mk │ ├── pfr.c │ ├── pfrcmap.c │ ├── pfrcmap.h │ ├── pfrdrivr.c │ ├── pfrdrivr.h │ ├── pfrerror.h │ ├── pfrgload.c │ ├── pfrgload.h │ ├── pfrload.c │ ├── pfrload.h │ ├── pfrobjs.c │ ├── pfrobjs.h │ ├── pfrsbit.c │ ├── pfrsbit.h │ ├── pfrtypes.h │ └── rules.mk │ ├── psaux │ ├── Jamfile │ ├── afmparse.c │ ├── afmparse.h │ ├── module.mk │ ├── psaux.c │ ├── psauxerr.h │ ├── psauxmod.c │ ├── psauxmod.h │ ├── psconv.c │ ├── psconv.h │ ├── psobjs.c │ ├── psobjs.h │ ├── rules.mk │ ├── t1cmap.c │ ├── t1cmap.h │ ├── t1decode.c │ └── t1decode.h │ ├── pshinter │ ├── Jamfile │ ├── module.mk │ ├── pshalgo.c │ ├── pshalgo.h │ ├── pshglob.c │ ├── pshglob.h │ ├── pshinter.c │ ├── pshmod.c │ ├── pshmod.h │ ├── pshnterr.h │ ├── pshpic.c │ ├── pshpic.h │ ├── pshrec.c │ ├── pshrec.h │ └── rules.mk │ ├── psnames │ ├── Jamfile │ ├── module.mk │ ├── psmodule.c │ ├── psmodule.h │ ├── psnamerr.h │ ├── psnames.c │ ├── pspic.c │ ├── pspic.h │ ├── pstables.h │ └── rules.mk │ ├── raster │ ├── Jamfile │ ├── ftmisc.h │ ├── ftraster.c │ ├── ftraster.h │ ├── ftrend1.c │ ├── ftrend1.h │ ├── module.mk │ ├── raster.c │ ├── rasterrs.h │ ├── rastpic.c │ ├── rastpic.h │ └── rules.mk │ ├── sfnt │ ├── Jamfile │ ├── module.mk │ ├── rules.mk │ ├── sfdriver.c │ ├── sfdriver.h │ ├── sferrors.h │ ├── sfnt.c │ ├── sfntpic.c │ ├── sfntpic.h │ ├── sfobjs.c │ ├── sfobjs.h │ ├── ttbdf.c │ ├── ttbdf.h │ ├── ttcmap.c │ ├── ttcmap.h │ ├── ttcmapc.h │ ├── ttkern.c │ ├── ttkern.h │ ├── ttload.c │ ├── ttload.h │ ├── ttmtx.c │ ├── ttmtx.h │ ├── ttpost.c │ ├── ttpost.h │ ├── ttsbit.c │ ├── ttsbit.h │ └── ttsbit0.c │ ├── smooth │ ├── Jamfile │ ├── ftgrays.c │ ├── ftgrays.h │ ├── ftsmerrs.h │ ├── ftsmooth.c │ ├── ftsmooth.h │ ├── ftspic.c │ ├── ftspic.h │ ├── module.mk │ ├── rules.mk │ └── smooth.c │ ├── tools │ ├── Jamfile │ ├── apinames.c │ ├── chktrcmp.py │ ├── cordic.py │ ├── docmaker │ │ ├── content.py │ │ ├── docbeauty.py │ │ ├── docmaker.py │ │ ├── formatter.py │ │ ├── sources.py │ │ ├── tohtml.py │ │ └── utils.py │ ├── ftrandom │ │ ├── Makefile │ │ ├── README │ │ └── ftrandom.c │ ├── glnames.py │ ├── test_afm.c │ ├── test_bbox.c │ └── test_trig.c │ ├── truetype │ ├── Jamfile │ ├── module.mk │ ├── rules.mk │ ├── truetype.c │ ├── ttdriver.c │ ├── ttdriver.h │ ├── tterrors.h │ ├── ttgload.c │ ├── ttgload.h │ ├── ttgxvar.c │ ├── ttgxvar.h │ ├── ttinterp.c │ ├── ttinterp.h │ ├── ttobjs.c │ ├── ttobjs.h │ ├── ttpic.c │ ├── ttpic.h │ ├── ttpload.c │ ├── ttpload.h │ ├── ttsubpix.c │ └── ttsubpix.h │ ├── type1 │ ├── Jamfile │ ├── module.mk │ ├── rules.mk │ ├── t1afm.c │ ├── t1afm.h │ ├── t1driver.c │ ├── t1driver.h │ ├── t1errors.h │ ├── t1gload.c │ ├── t1gload.h │ ├── t1load.c │ ├── t1load.h │ ├── t1objs.c │ ├── t1objs.h │ ├── t1parse.c │ ├── t1parse.h │ ├── t1tokens.h │ └── type1.c │ ├── type42 │ ├── Jamfile │ ├── module.mk │ ├── rules.mk │ ├── t42drivr.c │ ├── t42drivr.h │ ├── t42error.h │ ├── t42objs.c │ ├── t42objs.h │ ├── t42parse.c │ ├── t42parse.h │ ├── t42types.h │ └── type42.c │ └── winfonts │ ├── Jamfile │ ├── fnterrs.h │ ├── module.mk │ ├── rules.mk │ ├── winfnt.c │ └── winfnt.h ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── main ├── CMakeLists.txt ├── build.gradle └── src │ ├── SDL_android_main.c │ └── main.cpp └── settings.gradle /.github/workflows/build-sdl2-android.yml: -------------------------------------------------------------------------------- 1 | name: build-and-release 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | 8 | jobs: 9 | build-creator: 10 | name: Build & Release APK 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v2.3.4 15 | 16 | - name: Get current time 17 | uses: srfrnk/current-time@master 18 | id: current-time 19 | with: 20 | format: DD-MM-YYYY 21 | 22 | - name: Updating Build Tools 23 | run: sudo apt update && sudo apt upgrade 24 | 25 | - name: Setup Java Envirionment 26 | uses: actions/setup-java@v2.1.0 27 | with: 28 | distribution: adopt-hotspot 29 | java-version: 15 30 | 31 | - name: Building with Gradle 32 | uses: eskatos/gradle-command-action@v1.3.3 33 | with: 34 | gradle-version: 6.9 35 | wrapper-cache-enabled: true 36 | dependencies-cache-enabled: true 37 | configuration-cache-enabled: true 38 | arguments: 'build -x lint' 39 | 40 | - name: Upload APK Files to Release 41 | uses: softprops/action-gh-release@v1 42 | with: 43 | name: "Auto Build ${{ steps.current-time.outputs.formattedTime }}" 44 | # tag_name: v1.0.2 45 | prerelease: true 46 | body: | 47 | This is an Automatic Release by GitHub Actions. 48 | APK marked "unsigned" needs to be signed with test key before installing. 49 | This may change in Future. 50 | files: | 51 | ./app/build/outputs/apk/*/*/*.apk 52 | env: 53 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Compiled libraries 12 | *.so 13 | 14 | # Generated files 15 | bin/ 16 | gen/ 17 | out/ 18 | 19 | # Gradle files 20 | .gradle/ 21 | build/ 22 | 23 | # Local configuration file (sdk path, etc) 24 | local.properties 25 | 26 | # Proguard folder generated by Eclipse 27 | proguard/ 28 | 29 | # Log Files 30 | *.log 31 | 32 | # Android Studio Navigation editor temp files 33 | .navigation/ 34 | 35 | # Android Studio captures folder 36 | captures/ 37 | 38 | # Intellij 39 | *.iml 40 | .idea/workspace.xml 41 | .idea/tasks.xml 42 | .idea/gradle.xml 43 | .idea/dictionaries 44 | .idea/libraries 45 | 46 | # Keystore files 47 | *.jks 48 | 49 | # External native build folder generated in Android Studio 2.2 and later 50 | .externalNativeBuild 51 | 52 | # Google Services (e.g. APIs or Firebase) 53 | google-services.json 54 | 55 | # Freeline 56 | freeline.py 57 | freeline/ 58 | freeline_project_description.json 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SDL2 Android Example 2 | 3 | Read article at blog: https://georgik.rocks/tag/sdl2/ 4 | 5 | Source code: 6 | 7 | - the code is assembled of several pieces available on GitHub 8 | 9 | ## Dependencies 10 | 11 | ### Gradle 12 | 13 | The project is compatible with Gradle 5 & 6. For older version based on Gradle 4 and Android Experimental Plugin, check out branch gradle-4-using-android-experimental-plugin. 14 | 15 | Android build Tools are set to v28.0.0 in file settings.gradle. Make sure to download those tools via Android Studio. 16 | 17 | 18 | ### Libraries 19 | 20 | - libSDL2_png - derrived from https://github.com/julienr/libpng-android 21 | - applied patch - https://github.com/julienr/libpng-android/issues/6 22 | - renamed to SDL2_png, because of problem with png library in API level 19 - http://georgik.rocks/sdl2-for-android-api-level-19/ 23 | - libSDL2_jpeg - derrived from https://www.libsdl.org/projects/SDL_image/libs/ 24 | - renamed to SDL2_jpeg from jpeg, because of library name collision in Android 25 | https://stackoverflow.com/questions/11613040/why-does-jpeg-decompress-create-crash-without-error-message 26 | 27 | 28 | ## Assets 29 | - Cuckoo Clock Sound - http://soundbible.com/1261-Cuckoo-Clock.html 30 | - Blazed font - http://www.all-free-download.com/ 31 | -------------------------------------------------------------------------------- /SDL2/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /SDL2/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef _SDLname_h_ 23 | #define _SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* _SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /SDL2/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /SDL2/include/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /SDL2/include/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /SDL2/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-10556:007dfe83abf8" 2 | #define SDL_REVISION_NUMBER 10556 3 | -------------------------------------------------------------------------------- /SDL2/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /SDL2/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #undef _begin_code_h 30 | 31 | /* Reset structure packing at previous byte alignment */ 32 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) 33 | #ifdef __BORLANDC__ 34 | #pragma nopackwarning 35 | #endif 36 | #pragma pack(pop) 37 | #endif /* Compiler needs structure packing set */ 38 | -------------------------------------------------------------------------------- /SDL2/src/SDL_assert_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | extern void SDL_AssertionsQuit(void); 23 | 24 | /* vi: set ts=4 sw=4 expandtab: */ 25 | -------------------------------------------------------------------------------- /SDL2/src/SDL_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #ifndef _SDL_internal_h 22 | #define _SDL_internal_h 23 | 24 | #include "dynapi/SDL_dynapi.h" 25 | 26 | #if SDL_DYNAMIC_API 27 | #include "dynapi/SDL_dynapi_overrides.h" 28 | /* force DECLSPEC and SDLCALL off...it's all internal symbols now. 29 | These will have actual #defines during SDL_dynapi.c only */ 30 | #define DECLSPEC 31 | #define SDLCALL 32 | #endif 33 | 34 | #include "SDL_config.h" 35 | 36 | #endif 37 | 38 | /* vi: set ts=4 sw=4 expandtab: */ 39 | -------------------------------------------------------------------------------- /SDL2/src/audio/SDL_audiodev_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "SDL.h" 22 | #include "../SDL_internal.h" 23 | #include "SDL_sysaudio.h" 24 | 25 | /* Open the audio device for playback, and don't block if busy */ 26 | /* #define USE_BLOCKING_WRITES */ 27 | 28 | #ifdef USE_BLOCKING_WRITES 29 | #define OPEN_FLAGS_OUTPUT O_WRONLY 30 | #define OPEN_FLAGS_INPUT O_RDONLY 31 | #else 32 | #define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK) 33 | #define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) 34 | #endif 35 | 36 | extern void SDL_EnumUnixAudioDevices(const int classic, int (*test)(int)); 37 | 38 | /* vi: set ts=4 sw=4 expandtab: */ 39 | -------------------------------------------------------------------------------- /SDL2/src/audio/android/SDL_androidaudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #ifndef _SDL_androidaudio_h 24 | #define _SDL_androidaudio_h 25 | 26 | #include "../SDL_sysaudio.h" 27 | 28 | /* Hidden "this" pointer for the audio functions */ 29 | #define _THIS SDL_AudioDevice *this 30 | 31 | struct SDL_PrivateAudioData 32 | { 33 | /* Resume device if it was paused automatically */ 34 | int resume; 35 | }; 36 | 37 | #endif /* _SDL_androidaudio_h */ 38 | 39 | /* vi: set ts=4 sw=4 expandtab: */ 40 | -------------------------------------------------------------------------------- /SDL2/src/audio/dummy/SDL_dummyaudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #ifndef _SDL_dummyaudio_h 24 | #define _SDL_dummyaudio_h 25 | 26 | #include "../SDL_sysaudio.h" 27 | 28 | /* Hidden "this" pointer for the audio functions */ 29 | #define _THIS SDL_AudioDevice *this 30 | 31 | struct SDL_PrivateAudioData 32 | { 33 | /* The file descriptor for the audio device */ 34 | Uint8 *mixbuf; 35 | Uint32 mixlen; 36 | Uint32 write_delay; 37 | Uint32 initial_calls; 38 | }; 39 | 40 | #endif /* _SDL_dummyaudio_h */ 41 | /* vi: set ts=4 sw=4 expandtab: */ 42 | -------------------------------------------------------------------------------- /SDL2/src/audio/paudio/SDL_paudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #ifndef _SDL_paudaudio_h 24 | #define _SDL_paudaudio_h 25 | 26 | #include "../SDL_sysaudio.h" 27 | 28 | /* Hidden "this" pointer for the audio functions */ 29 | #define _THIS SDL_AudioDevice *this 30 | 31 | struct SDL_PrivateAudioData 32 | { 33 | /* The file descriptor for the audio device */ 34 | int audio_fd; 35 | 36 | /* Raw mixing buffer */ 37 | Uint8 *mixbuf; 38 | int mixlen; 39 | 40 | /* Support for audio timing using a timer, in addition to select() */ 41 | float frame_ticks; 42 | float next_frame; 43 | }; 44 | #define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ 45 | 46 | #endif /* _SDL_paudaudio_h */ 47 | /* vi: set ts=4 sw=4 expandtab: */ 48 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_clipboardevents.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Clipboard event handling code for SDL */ 24 | 25 | #include "SDL_events.h" 26 | #include "SDL_events_c.h" 27 | #include "SDL_clipboardevents_c.h" 28 | 29 | 30 | int 31 | SDL_SendClipboardUpdate(void) 32 | { 33 | int posted; 34 | 35 | /* Post the event, if desired */ 36 | posted = 0; 37 | if (SDL_GetEventState(SDL_CLIPBOARDUPDATE) == SDL_ENABLE) { 38 | SDL_Event event; 39 | event.type = SDL_CLIPBOARDUPDATE; 40 | 41 | posted = (SDL_PushEvent(&event) > 0); 42 | } 43 | return (posted); 44 | } 45 | 46 | /* vi: set ts=4 sw=4 expandtab: */ 47 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_clipboardevents_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #ifndef _SDL_clipboardevents_c_h 24 | #define _SDL_clipboardevents_c_h 25 | 26 | extern int SDL_SendClipboardUpdate(void); 27 | 28 | #endif /* _SDL_clipboardevents_c_h */ 29 | 30 | /* vi: set ts=4 sw=4 expandtab: */ 31 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_dropevents_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #ifndef _SDL_dropevents_c_h 24 | #define _SDL_dropevents_c_h 25 | 26 | extern int SDL_SendDropFile(SDL_Window *window, const char *file); 27 | extern int SDL_SendDropText(SDL_Window *window, const char *text); 28 | extern int SDL_SendDropComplete(SDL_Window *window); 29 | 30 | #endif /* _SDL_dropevents_c_h */ 31 | 32 | /* vi: set ts=4 sw=4 expandtab: */ 33 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_gesture_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #ifndef _SDL_gesture_c_h 24 | #define _SDL_gesture_c_h 25 | 26 | extern int SDL_GestureAddTouch(SDL_TouchID touchId); 27 | 28 | extern void SDL_GestureProcessEvent(SDL_Event* event); 29 | 30 | extern int SDL_RecordGesture(SDL_TouchID touchId); 31 | 32 | #endif /* _SDL_gesture_c_h */ 33 | 34 | /* vi: set ts=4 sw=4 expandtab: */ 35 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_sysevents.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #include "../video/SDL_sysvideo.h" 24 | 25 | /* Useful functions and variables from SDL_sysevents.c */ 26 | 27 | #if defined(__HAIKU__) 28 | /* The Haiku event loops run in a separate thread */ 29 | #define MUST_THREAD_EVENTS 30 | #endif 31 | 32 | #ifdef __WIN32__ /* Windows doesn't allow a separate event thread */ 33 | #define CANT_THREAD_EVENTS 34 | #endif 35 | 36 | /* vi: set ts=4 sw=4 expandtab: */ 37 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_windowevents_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #ifndef _SDL_windowevents_c_h 24 | #define _SDL_windowevents_c_h 25 | 26 | extern int SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, 27 | int data1, int data2); 28 | 29 | #endif /* _SDL_windowevents_c_h */ 30 | 31 | /* vi: set ts=4 sw=4 expandtab: */ 32 | -------------------------------------------------------------------------------- /SDL2/src/events/blank_cursor.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 23 | * A default blank 8x8 cursor */ 24 | 25 | #define BLANK_CWIDTH 8 26 | #define BLANK_CHEIGHT 8 27 | #define BLANK_CHOTX 0 28 | #define BLANK_CHOTY 0 29 | 30 | static const unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 31 | static const unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /SDL2/src/events/default_cursor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/SDL2/src/events/default_cursor.h -------------------------------------------------------------------------------- /SDL2/src/haptic/SDL_haptic_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | extern int SDL_HapticInit(void); 23 | extern void SDL_HapticQuit(void); 24 | 25 | /* vi: set ts=4 sw=4 expandtab: */ 26 | -------------------------------------------------------------------------------- /SDL2/src/libm/math_libm.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Math routines from uClibc: http://www.uclibc.org */ 24 | 25 | double SDL_uclibc_atan(double x); 26 | double SDL_uclibc_atan2(double y, double x); 27 | double SDL_uclibc_copysign(double x, double y); 28 | double SDL_uclibc_cos(double x); 29 | double SDL_uclibc_fabs(double x); 30 | double SDL_uclibc_floor(double x); 31 | double SDL_uclibc_log(double x); 32 | double SDL_uclibc_pow(double x, double y); 33 | double SDL_uclibc_scalbn(double x, int n); 34 | double SDL_uclibc_sin(double x); 35 | double SDL_uclibc_sqrt(double x); 36 | double SDL_uclibc_tan(double x); 37 | 38 | /* vi: set ts=4 sw=4 expandtab: */ 39 | -------------------------------------------------------------------------------- /SDL2/src/libm/s_copysign.c: -------------------------------------------------------------------------------- 1 | /* @(#)s_copysign.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | #if defined(LIBM_SCCS) && !defined(lint) 14 | static const char rcsid[] = 15 | "$NetBSD: s_copysign.c,v 1.8 1995/05/10 20:46:57 jtc Exp $"; 16 | #endif 17 | 18 | /* 19 | * copysign(double x, double y) 20 | * copysign(x,y) returns a value with the magnitude of x and 21 | * with the sign bit of y. 22 | */ 23 | 24 | #include "math_libm.h" 25 | #include "math_private.h" 26 | 27 | libm_hidden_proto(copysign) 28 | #ifdef __STDC__ 29 | double copysign(double x, double y) 30 | #else 31 | double copysign(x, y) 32 | double x, y; 33 | #endif 34 | { 35 | u_int32_t hx, hy; 36 | GET_HIGH_WORD(hx, x); 37 | GET_HIGH_WORD(hy, y); 38 | SET_HIGH_WORD(x, (hx & 0x7fffffff) | (hy & 0x80000000)); 39 | return x; 40 | } 41 | 42 | libm_hidden_def(copysign) 43 | -------------------------------------------------------------------------------- /SDL2/src/libm/s_fabs.c: -------------------------------------------------------------------------------- 1 | /* @(#)s_fabs.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | #if defined(LIBM_SCCS) && !defined(lint) 14 | static const char rcsid[] = 15 | "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $"; 16 | #endif 17 | 18 | /* 19 | * fabs(x) returns the absolute value of x. 20 | */ 21 | 22 | #include "math_libm.h" 23 | #include "math_private.h" 24 | 25 | libm_hidden_proto(fabs) 26 | #ifdef __STDC__ 27 | double fabs(double x) 28 | #else 29 | double fabs(x) 30 | double x; 31 | #endif 32 | { 33 | u_int32_t high; 34 | GET_HIGH_WORD(high, x); 35 | SET_HIGH_WORD(x, high & 0x7fffffff); 36 | return x; 37 | } 38 | 39 | libm_hidden_def(fabs) 40 | -------------------------------------------------------------------------------- /SDL2/src/render/opengl/SDL_shaders_gl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | /* OpenGL shader implementation */ 24 | 25 | typedef enum { 26 | SHADER_NONE, 27 | SHADER_SOLID, 28 | SHADER_RGB, 29 | SHADER_YUV, 30 | SHADER_NV12, 31 | SHADER_NV21, 32 | NUM_SHADERS 33 | } GL_Shader; 34 | 35 | typedef struct GL_ShaderContext GL_ShaderContext; 36 | 37 | extern GL_ShaderContext * GL_CreateShaderContext(); 38 | extern void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader); 39 | extern void GL_DestroyShaderContext(GL_ShaderContext *ctx); 40 | 41 | /* vi: set ts=4 sw=4 expandtab: */ 42 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_blendfillrect.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 25 | extern int SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_blendline.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 25 | extern int SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_blendpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 25 | extern int SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_drawline.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color); 25 | extern int SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_drawpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color); 25 | extern int SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_render_sw_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface); 23 | 24 | /* vi: set ts=4 sw=4 expandtab: */ 25 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_rotate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef MIN 23 | #define MIN(a,b) (((a) < (b)) ? (a) : (b)) 24 | #endif 25 | 26 | extern SDL_Surface *SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle); 27 | extern void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle); 28 | 29 | -------------------------------------------------------------------------------- /SDL2/src/test/SDL_test_font.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/SDL2/src/test/SDL_test_font.c -------------------------------------------------------------------------------- /SDL2/src/thread/pthread/SDL_sysmutex_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #ifndef _SDL_mutex_c_h 24 | #define _SDL_mutex_c_h 25 | 26 | struct SDL_mutex 27 | { 28 | pthread_mutex_t id; 29 | }; 30 | 31 | #endif /* _SDL_mutex_c_h */ 32 | /* vi: set ts=4 sw=4 expandtab: */ 33 | -------------------------------------------------------------------------------- /SDL2/src/thread/pthread/SDL_systhread_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #include 24 | 25 | typedef pthread_t SYS_ThreadHandle; 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/timer/SDL_timer_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Useful functions and variables from SDL_timer.c */ 24 | #include "SDL_timer.h" 25 | 26 | #define ROUND_RESOLUTION(X) \ 27 | (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION) 28 | 29 | extern void SDL_TicksInit(void); 30 | extern void SDL_TicksQuit(void); 31 | extern int SDL_TimerInit(void); 32 | extern void SDL_TimerQuit(void); 33 | 34 | /* vi: set ts=4 sw=4 expandtab: */ 35 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_RLEaccel.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/SDL2/src/video/SDL_RLEaccel.c -------------------------------------------------------------------------------- /SDL2/src/video/SDL_RLEaccel_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Useful functions and variables from SDL_RLEaccel.c */ 24 | 25 | extern int SDL_RLESurface(SDL_Surface * surface); 26 | extern int SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect, 27 | SDL_Surface * dst, SDL_Rect * dstrect); 28 | extern int SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect, 29 | SDL_Surface * dst, SDL_Rect * dstrect); 30 | extern void SDL_UnRLESurface(SDL_Surface * surface, int recode); 31 | /* vi: set ts=4 sw=4 expandtab: */ 32 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_blit_auto.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ 2 | /* 3 | Simple DirectMedia Layer 4 | Copyright (C) 1997-2016 Sam Lantinga 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. 21 | */ 22 | #include "../SDL_internal.h" 23 | 24 | /* *INDENT-OFF* */ 25 | 26 | extern SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]; 27 | 28 | /* *INDENT-ON* */ 29 | 30 | /* vi: set ts=4 sw=4 expandtab: */ 31 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_blit_copy.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | void SDL_BlitCopy(SDL_BlitInfo * info); 23 | 24 | /* vi: set ts=4 sw=4 expandtab: */ 25 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_blit_slow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | extern void SDL_Blit_Slow(SDL_BlitInfo * info); 24 | 25 | /* vi: set ts=4 sw=4 expandtab: */ 26 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_pixels_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Useful functions and variables from SDL_pixel.c */ 24 | 25 | #include "SDL_blit.h" 26 | 27 | /* Pixel format functions */ 28 | extern int SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format); 29 | 30 | /* Blit mapping functions */ 31 | extern SDL_BlitMap *SDL_AllocBlitMap(void); 32 | extern void SDL_InvalidateMap(SDL_BlitMap * map); 33 | extern int SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst); 34 | extern void SDL_FreeBlitMap(SDL_BlitMap * map); 35 | 36 | /* Miscellaneous functions */ 37 | extern int SDL_CalculatePitch(SDL_Surface * surface); 38 | extern void SDL_DitherColors(SDL_Color * colors, int bpp); 39 | extern Uint8 SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 40 | 41 | /* vi: set ts=4 sw=4 expandtab: */ 42 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_rect_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect * rects, SDL_Rect *span); 24 | 25 | /* vi: set ts=4 sw=4 expandtab: */ 26 | -------------------------------------------------------------------------------- /SDL2/src/video/android/SDL_androidclipboard.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #if SDL_VIDEO_DRIVER_ANDROID 24 | 25 | #include "SDL_androidvideo.h" 26 | 27 | #include "../../core/android/SDL_android.h" 28 | 29 | int 30 | Android_SetClipboardText(_THIS, const char *text) 31 | { 32 | return Android_JNI_SetClipboardText(text); 33 | } 34 | 35 | char * 36 | Android_GetClipboardText(_THIS) 37 | { 38 | return Android_JNI_GetClipboardText(); 39 | } 40 | 41 | SDL_bool Android_HasClipboardText(_THIS) 42 | { 43 | return Android_JNI_HasClipboardText(); 44 | } 45 | 46 | #endif /* SDL_VIDEO_DRIVER_ANDROID */ 47 | 48 | /* vi: set ts=4 sw=4 expandtab: */ 49 | -------------------------------------------------------------------------------- /SDL2/src/video/android/SDL_androidclipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #ifndef _SDL_androidclipboard_h 24 | #define _SDL_androidclipboard_h 25 | 26 | extern int Android_SetClipboardText(_THIS, const char *text); 27 | extern char *Android_GetClipboardText(_THIS); 28 | extern SDL_bool Android_HasClipboardText(_THIS); 29 | 30 | #endif /* _SDL_androidclipboard_h */ 31 | 32 | /* vi: set ts=4 sw=4 expandtab: */ 33 | -------------------------------------------------------------------------------- /SDL2/src/video/android/SDL_androidevents.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #include "SDL_androidvideo.h" 24 | 25 | extern void Android_PumpEvents(_THIS); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/video/android/SDL_androidkeyboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #include "SDL_androidvideo.h" 24 | 25 | extern void Android_InitKeyboard(void); 26 | extern int Android_OnKeyDown(int keycode); 27 | extern int Android_OnKeyUp(int keycode); 28 | 29 | extern SDL_bool Android_HasScreenKeyboardSupport(_THIS); 30 | extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window * window); 31 | 32 | extern void Android_StartTextInput(_THIS); 33 | extern void Android_StopTextInput(_THIS); 34 | extern void Android_SetTextInputRect(_THIS, SDL_Rect *rect); 35 | 36 | /* vi: set ts=4 sw=4 expandtab: */ 37 | -------------------------------------------------------------------------------- /SDL2/src/video/android/SDL_androidmessagebox.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #if SDL_VIDEO_DRIVER_ANDROID 24 | 25 | #include "SDL_messagebox.h" 26 | 27 | int 28 | Android_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) 29 | { 30 | int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); 31 | 32 | return Android_JNI_ShowMessageBox(messageboxdata, buttonid); 33 | } 34 | 35 | #endif /* SDL_VIDEO_DRIVER_ANDROID */ 36 | 37 | /* vi: set ts=4 sw=4 expandtab: */ 38 | -------------------------------------------------------------------------------- /SDL2/src/video/android/SDL_androidmessagebox.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #if SDL_VIDEO_DRIVER_ANDROID 24 | 25 | extern int Android_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); 26 | 27 | #endif /* SDL_VIDEO_DRIVER_ANDROID */ 28 | 29 | /* vi: set ts=4 sw=4 expandtab: */ 30 | -------------------------------------------------------------------------------- /SDL2/src/video/android/SDL_androidmouse.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef _SDL_androidmouse_h 23 | #define _SDL_androidmouse_h 24 | 25 | #include "SDL_androidvideo.h" 26 | 27 | extern void Android_InitMouse(void); 28 | extern void Android_OnMouse( int button, int action, float x, float y); 29 | 30 | #endif /* _SDL_androidmouse_h */ 31 | 32 | /* vi: set ts=4 sw=4 expandtab: */ 33 | -------------------------------------------------------------------------------- /SDL2/src/video/android/SDL_androidtouch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #include "SDL_androidvideo.h" 24 | 25 | extern void Android_InitTouch(void); 26 | extern void Android_QuitTouch(void); 27 | extern void Android_OnTouch( int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p); 28 | 29 | /* vi: set ts=4 sw=4 expandtab: */ 30 | -------------------------------------------------------------------------------- /SDL2_gfx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required(VERSION 3.4.1) 3 | project(SDL2_gfx) 4 | 5 | 6 | find_library( # Sets the name of the path variable. 7 | GLESv1_CM 8 | 9 | GLESv1_CM ) 10 | 11 | find_library( 12 | GLESv2 13 | GLESv2 14 | ) 15 | 16 | find_library( 17 | android 18 | android 19 | ) 20 | 21 | find_library( 22 | z 23 | z 24 | ) 25 | 26 | find_library( 27 | log 28 | log 29 | ) 30 | 31 | include_directories(include) 32 | 33 | add_definitions(-DGL_GLEXT_PROTOTYPES) 34 | 35 | add_library( # Sets the name of the library. 36 | SDL2_gfx 37 | 38 | # Sets the library as a shared library. 39 | SHARED 40 | 41 | src/SDL2_framerate.c 42 | src/SDL2_gfxPrimitives.c 43 | src/SDL2_rotozoom.c 44 | src/SDL2_imageFilter.c 45 | ) 46 | 47 | 48 | target_link_libraries( 49 | SDL2_gfx 50 | SDL2 51 | GLESv1_CM 52 | GLESv2 53 | android 54 | z 55 | log 56 | ) -------------------------------------------------------------------------------- /SDL2_gfx/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.model.native' 2 | 3 | def lib_distribution_root = '../distribution' 4 | model { 5 | 6 | android { 7 | compileSdkVersion = gradle.sdkVersion 8 | buildToolsVersion = gradle.buildToolsVersion 9 | 10 | defaultConfig { 11 | minSdkVersion.apiLevel = 13 12 | targetSdkVersion.apiLevel = gradle.sdkVersion 13 | versionCode = 1 14 | versionName = '1.0' 15 | } 16 | ndk { 17 | moduleName = 'SDL2_gfx' 18 | ldLibs.addAll(["GLESv1_CM", "EGL", "GLESv2", "log", "android", "dl"]) 19 | CFlags.addAll(["-DGL_GLEXT_PROTOTYPES"]) 20 | CFlags.addAll(["-I" + file("include/").absolutePath,"-DGL_GLEXT_PROTOTYPES"]) 21 | } 22 | 23 | sources { 24 | main { 25 | jni { 26 | dependencies { 27 | project ':SDL2' linkage 'shared' 28 | } 29 | exportedHeaders { 30 | srcDir "../SDL2/include" 31 | } 32 | source { 33 | srcDir "src" 34 | } 35 | } 36 | } 37 | } 38 | 39 | } 40 | } 41 | 42 | // This is just copy out the header file and built lib into distribution 43 | // directory for clint application to use; it is a small overhead of this sample: 44 | // both lib and app are put inside one project space [save maintenance time] 45 | task(distributeLib, type : Copy) { 46 | // trigger build library 47 | dependsOn assemble 48 | into '../distribution/SDL2_gfx/' 49 | from('build/outputs/native/release/lib') { 50 | into 'lib/' 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /SDL2_gfx/include/SDL2_gfxPrimitives_font.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/SDL2_gfx/include/SDL2_gfxPrimitives_font.h -------------------------------------------------------------------------------- /SDL2_image/src/IMG_tga.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/SDL2_image/src/IMG_tga.c -------------------------------------------------------------------------------- /SDL2_jpeg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.model.native' 2 | 3 | model { 4 | android { 5 | compileSdkVersion = gradle.sdkVersion 6 | buildToolsVersion = gradle.buildToolsVersion 7 | 8 | defaultConfig { 9 | minSdkVersion.apiLevel = gradle.minSdkVersion 10 | versionCode = 1 11 | versionName = '1.0' 12 | } 13 | ndk { 14 | moduleName = 'SDL2_jpeg' 15 | ldLibs.addAll(["GLESv1_CM", "EGL", "GLESv2", "log", "android", "dl", "z"]) 16 | CFlags.addAll([ 17 | "-DGL_GLEXT_PROTOTYPES" 18 | ]) 19 | CFlags.addAll(["-I" + file("include/").absolutePath,"-DGL_GLEXT_PROTOTYPES"]) 20 | } 21 | 22 | sources { 23 | main { 24 | jni { 25 | source { 26 | srcDir "src" 27 | exclude "cjpeg.c" 28 | exclude "ckconfig.c" 29 | exclude "djpeg.c" 30 | exclude "example.c" 31 | exclude "jmemansi.c" 32 | exclude "jmemdos.c" 33 | exclude "jmemmac.c" 34 | exclude "jmemname.c" 35 | exclude "jmemnobs.c" 36 | exclude "jpegtran.c" 37 | exclude "rdjpgcom.c" 38 | } 39 | } 40 | } 41 | } 42 | 43 | } 44 | } 45 | 46 | task(distributeLib, type : Copy) { 47 | // trigger build library 48 | dependsOn assemble 49 | into gradle.libDistributionRoot + '/SDL2_jpeg/' 50 | from('build/outputs/native/release/lib') { 51 | into 'lib/' 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /SDL2_jpeg/include/jversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jversion.h 3 | * 4 | * Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains software version identification. 9 | */ 10 | 11 | 12 | #define JVERSION "9 13-Jan-2013" 13 | 14 | #define JCOPYRIGHT "Copyright (C) 2013, Thomas G. Lane, Guido Vollbeding" 15 | -------------------------------------------------------------------------------- /SDL2_jpeg/src/rdgif.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rdgif.c 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains routines to read input images in GIF format. 9 | * 10 | ***************************************************************************** 11 | * NOTE: to avoid entanglements with Unisys' patent on LZW compression, * 12 | * the ability to read GIF files has been removed from the IJG distribution. * 13 | * Sorry about that. * 14 | ***************************************************************************** 15 | * 16 | * We are required to state that 17 | * "The Graphics Interchange Format(c) is the Copyright property of 18 | * CompuServe Incorporated. GIF(sm) is a Service Mark property of 19 | * CompuServe Incorporated." 20 | */ 21 | 22 | #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ 23 | 24 | #ifdef GIF_SUPPORTED 25 | 26 | /* 27 | * The module selection routine for GIF format input. 28 | */ 29 | 30 | GLOBAL(cjpeg_source_ptr) 31 | jinit_read_gif (j_compress_ptr cinfo) 32 | { 33 | fprintf(stderr, "GIF input is unsupported for legal reasons. Sorry.\n"); 34 | exit(EXIT_FAILURE); 35 | return NULL; /* keep compiler happy */ 36 | } 37 | 38 | #endif /* GIF_SUPPORTED */ 39 | -------------------------------------------------------------------------------- /SDL2_mixer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required(VERSION 3.4.1) 3 | project(SDL2_mixer) 4 | 5 | 6 | find_library( # Sets the name of the path variable. 7 | GLESv1_CM 8 | 9 | GLESv1_CM ) 10 | 11 | find_library( 12 | GLESv2 13 | GLESv2 14 | ) 15 | 16 | find_library( 17 | android 18 | android 19 | ) 20 | 21 | find_library( 22 | z 23 | z 24 | ) 25 | 26 | find_library( 27 | log 28 | log 29 | ) 30 | 31 | include_directories(include) 32 | 33 | add_definitions(-DGL_GLEXT_PROTOTYPES) 34 | 35 | add_library( # Sets the name of the library. 36 | SDL2_mixer 37 | 38 | # Sets the library as a shared library. 39 | SHARED 40 | 41 | src/music_mad.c 42 | src/dynamic_flac.c 43 | src/load_aiff.c 44 | src/load_voc.c 45 | src/dynamic_ogg.c 46 | src/load_mp3.c 47 | src/mixer.c 48 | src/playmus.c 49 | src/music_ogg.c 50 | src/music_cmd.c 51 | src/music_mod.c 52 | src/load_flac.c 53 | src/dynamic_fluidsynth.c 54 | src/fluidsynth.c 55 | src/effect_stereoreverse.c 56 | src/music.c 57 | src/dynamic_mod.c 58 | src/effects_internal.c 59 | src/dynamic_modplug.c 60 | src/dynamic_mp3.c 61 | src/load_ogg.c 62 | src/wavestream.c 63 | src/effect_position.c 64 | src/music_modplug.c 65 | src/music_flac.c 66 | ) 67 | 68 | 69 | target_link_libraries( 70 | SDL2_mixer 71 | SDL2 72 | GLESv1_CM 73 | GLESv2 74 | android 75 | z 76 | log 77 | ) -------------------------------------------------------------------------------- /SDL2_mixer/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.model.native' 2 | 3 | def lib_distribution_root = '../distribution' 4 | model { 5 | 6 | android { 7 | compileSdkVersion = gradle.sdkVersion 8 | buildToolsVersion = gradle.buildToolsVersion 9 | 10 | defaultConfig { 11 | minSdkVersion.apiLevel = 13 12 | targetSdkVersion.apiLevel = gradle.sdkVersion 13 | versionCode = 1 14 | versionName = '1.0' 15 | } 16 | ndk { 17 | moduleName = 'SDL2_mixer' 18 | ldLibs.addAll(["GLESv1_CM", "EGL", "GLESv2", "log", "android", "dl"]) 19 | CFlags.addAll(["-DGL_GLEXT_PROTOTYPES"]) 20 | CFlags.addAll(["-I" + file("include/").absolutePath,"-DGL_GLEXT_PROTOTYPES"]) 21 | } 22 | 23 | sources { 24 | main { 25 | jni { 26 | dependencies { 27 | project ':SDL2' linkage 'shared' 28 | } 29 | exportedHeaders { 30 | srcDir "../SDL2/include" 31 | } 32 | source { 33 | srcDir "src" 34 | exclude "playwave.c" 35 | } 36 | } 37 | } 38 | } 39 | 40 | } 41 | } 42 | 43 | // This is just copy out the header file and built lib into distribution 44 | // directory for clint application to use; it is a small overhead of this sample: 45 | // both lib and app are put inside one project space [save maintenance time] 46 | task(distributeLib, type : Copy) { 47 | // trigger build library 48 | dependsOn assemble 49 | into '../distribution/SDL2_mixer/' 50 | from('build/outputs/native/release/lib') { 51 | into 'lib/' 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /SDL2_mixer/include/load_aiff.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/SDL2_mixer/include/load_aiff.h -------------------------------------------------------------------------------- /SDL2_mixer/include/load_flac.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | This is the source needed to decode a FLAC into a waveform. 22 | ~ Austen Dicken (admin@cvpcs.org). 23 | */ 24 | 25 | /* $Id: $ */ 26 | 27 | #ifdef FLAC_MUSIC 28 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */ 29 | SDL_AudioSpec *Mix_LoadFLAC_RW (SDL_RWops *src, int freesrc, 30 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); 31 | #endif 32 | -------------------------------------------------------------------------------- /SDL2_mixer/include/load_mp3.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | This is the source needed to decode an MP3 into a waveform. 22 | */ 23 | 24 | /* $Id$ */ 25 | 26 | #if defined(MP3_MUSIC) || defined(MP3_MAD_MUSIC) 27 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */ 28 | SDL_AudioSpec *Mix_LoadMP3_RW (SDL_RWops *src, int freesrc, 29 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); 30 | #endif 31 | -------------------------------------------------------------------------------- /SDL2_mixer/include/load_ogg.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | This is the source needed to decode an Ogg Vorbis into a waveform. 22 | This file by Vaclav Slavik (vaclav.slavik@matfyz.cz). 23 | */ 24 | 25 | /* $Id$ */ 26 | 27 | #ifdef OGG_MUSIC 28 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */ 29 | SDL_AudioSpec *Mix_LoadOGG_RW (SDL_RWops *src, int freesrc, 30 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); 31 | #endif 32 | -------------------------------------------------------------------------------- /SDL2_mixer/include/load_voc.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2016 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | This is the source needed to decode a Creative Labs VOC file into a 22 | waveform. It's pretty straightforward once you get going. The only 23 | externally-callable function is Mix_LoadVOC_RW(), which is meant to 24 | act as identically to SDL_LoadWAV_RW() as possible. 25 | 26 | This file by Ryan C. Gordon (icculus@icculus.org). 27 | 28 | Heavily borrowed from sox v12.17.1's voc.c. 29 | (http://www.freshmeat.net/projects/sox/) 30 | */ 31 | 32 | /* $Id$ */ 33 | 34 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */ 35 | SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc, 36 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); 37 | -------------------------------------------------------------------------------- /SDL2_mixer/src/load_aiff.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/SDL2_mixer/src/load_aiff.c -------------------------------------------------------------------------------- /SDL2_png/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.model.native' 2 | 3 | model { 4 | android { 5 | compileSdkVersion = gradle.sdkVersion 6 | buildToolsVersion = gradle.buildToolsVersion 7 | 8 | defaultConfig { 9 | minSdkVersion.apiLevel = gradle.minSdkVersion 10 | versionCode = 1 11 | versionName = '1.0' 12 | } 13 | ndk { 14 | moduleName = 'SDL2_png' 15 | ldLibs.addAll(["GLESv1_CM", "EGL", "GLESv2", "log", "android", "dl", "z"]) 16 | CFlags.addAll([ 17 | "-DGL_GLEXT_PROTOTYPES" 18 | ]) 19 | CFlags.addAll(["-I" + file("include/").absolutePath,"-DGL_GLEXT_PROTOTYPES"]) 20 | } 21 | 22 | sources { 23 | main { 24 | jni { 25 | source { 26 | srcDir "src" 27 | } 28 | } 29 | } 30 | } 31 | 32 | } 33 | } 34 | 35 | task(distributeLib, type : Copy) { 36 | // trigger build library 37 | dependsOn assemble 38 | into gradle.libDistributionRoot + '/SDL2_png/' 39 | from('build/outputs/native/release/lib') { 40 | into 'lib/' 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /SDL2_png/include/pngprefix.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/SDL2_png/include/pngprefix.h -------------------------------------------------------------------------------- /SDL2_ttf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.4.1) 7 | project(SDL2_ttf) 8 | 9 | # Creates and names a library, sets it as either STATIC 10 | # or SHARED, and provides the relative paths to its source code. 11 | # You can define multiple libraries, and CMake builds them for you. 12 | # Gradle automatically packages shared libraries with your APK. 13 | 14 | find_library( # Sets the name of the path variable. 15 | GLESv1_CM 16 | 17 | # Specifies the name of the NDK library that 18 | # you want CMake to locate. 19 | GLESv1_CM ) 20 | 21 | find_library( 22 | GLESv2 23 | GLESv2 24 | ) 25 | 26 | find_library( 27 | android 28 | android 29 | ) 30 | 31 | find_library( 32 | log 33 | log 34 | ) 35 | 36 | include_directories( 37 | include 38 | ${CMAKE_CURRENT_SOURCE_DIR}/../freetype/include 39 | ) 40 | 41 | add_definitions(-DGL_GLEXT_PROTOTYPES) 42 | 43 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../freetype/ ${CMAKE_CURRENT_SOURCE_DIR}/../freetype/) 44 | 45 | add_library( # Sets the name of the library. 46 | SDL2_ttf 47 | 48 | # Sets the library as a shared library. 49 | SHARED 50 | 51 | src/glfont.c 52 | src/SDL_ttf.c 53 | ) 54 | 55 | 56 | target_link_libraries( 57 | SDL2_ttf 58 | freetype 59 | SDL2 60 | GLESv1_CM 61 | GLESv2 62 | android 63 | log 64 | ) -------------------------------------------------------------------------------- /SDL2_ttf/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.model.native' 2 | 3 | model { 4 | android { 5 | compileSdkVersion = gradle.sdkVersion 6 | buildToolsVersion = gradle.buildToolsVersion 7 | 8 | defaultConfig { 9 | minSdkVersion.apiLevel = gradle.minSdkVersion 10 | versionCode = 1 11 | versionName = '1.0' 12 | } 13 | ndk { 14 | moduleName = 'SDL2_ttf' 15 | ldLibs.addAll(["GLESv1_CM", "EGL", "GLESv2", "log", "android", "dl"]) 16 | CFlags.addAll(["-DGL_GLEXT_PROTOTYPES"]) 17 | CFlags.addAll(["-I" + file("include/").absolutePath,"-DGL_GLEXT_PROTOTYPES"]) 18 | } 19 | 20 | sources { 21 | main { 22 | jni { 23 | dependencies { 24 | project ':SDL2' linkage 'shared' 25 | project ':freetype' linkage 'shared' 26 | } 27 | exportedHeaders { 28 | srcDir "../SDL2/include" 29 | srcDir "../freetype/include" 30 | } 31 | source { 32 | srcDir "src" 33 | exclude "showfont.c" 34 | } 35 | } 36 | } 37 | } 38 | 39 | } 40 | } 41 | 42 | task(distributeLib, type : Copy) { 43 | dependsOn assemble 44 | into '../distribution/SDL2_ttf/' 45 | from('build/outputs/native/release/lib') { 46 | into 'lib/' 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/assets/blazed.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/app/src/main/assets/blazed.ttf -------------------------------------------------------------------------------- /app/src/main/assets/brno-snow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/app/src/main/assets/brno-snow.jpg -------------------------------------------------------------------------------- /app/src/main/assets/cuckoo.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/app/src/main/assets/cuckoo.wav -------------------------------------------------------------------------------- /app/src/main/assets/smiley.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georgik/sdl2-android-example/f6020e9dec36b9722bad6bca5d8e8c0869c5e7f2/app/src/main/assets/smiley.png -------------------------------------------------------------------------------- /app/src/main/java/rocks/georgik/sdlapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package rocks.georgik.sdlapp; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.app.Activity; 6 | import android.view.View; 7 | 8 | public class MainActivity extends Activity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_main); 14 | } 15 | 16 | public void startSDLActivity(View view) { 17 | Intent intent = new Intent(this, SDLActivity.class); 18 | startActivity(intent); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 |