gosu 1.4.6 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/COPYING +2 -1
- data/dependencies/SDL/include/SDL3/SDL.h +91 -0
- data/dependencies/SDL/include/SDL3/SDL_assert.h +710 -0
- data/dependencies/SDL/include/SDL3/SDL_asyncio.h +550 -0
- data/dependencies/SDL/include/SDL3/SDL_atomic.h +692 -0
- data/dependencies/SDL/include/SDL3/SDL_audio.h +2382 -0
- data/dependencies/SDL/include/SDL3/SDL_begin_code.h +553 -0
- data/dependencies/SDL/include/{SDL_bits.h → SDL3/SDL_bits.h} +47 -27
- data/dependencies/SDL/include/{SDL_blendmode.h → SDL3/SDL_blendmode.h} +59 -55
- data/dependencies/SDL/include/SDL3/SDL_camera.h +535 -0
- data/dependencies/SDL/include/SDL3/SDL_clipboard.h +331 -0
- data/dependencies/SDL/include/{close_code.h → SDL3/SDL_close_code.h} +9 -8
- data/dependencies/SDL/include/{SDL_types.h → SDL3/SDL_copying.h} +2 -9
- data/dependencies/SDL/include/SDL3/SDL_cpuinfo.h +374 -0
- data/dependencies/SDL/include/SDL3/SDL_dialog.h +343 -0
- data/dependencies/SDL/include/SDL3/SDL_dlopennote.h +234 -0
- data/dependencies/SDL/include/{SDL_egl.h → SDL3/SDL_egl.h} +11 -8
- data/dependencies/SDL/include/SDL3/SDL_endian.h +645 -0
- data/dependencies/SDL/include/SDL3/SDL_error.h +226 -0
- data/dependencies/SDL/include/SDL3/SDL_events.h +1651 -0
- data/dependencies/SDL/include/SDL3/SDL_filesystem.h +537 -0
- data/dependencies/SDL/include/SDL3/SDL_gamepad.h +1657 -0
- data/dependencies/SDL/include/SDL3/SDL_gpu.h +4637 -0
- data/dependencies/SDL/include/SDL3/SDL_guid.h +106 -0
- data/dependencies/SDL/include/SDL3/SDL_haptic.h +1461 -0
- data/dependencies/SDL/include/SDL3/SDL_hidapi.h +571 -0
- data/dependencies/SDL/include/SDL3/SDL_hints.h +5041 -0
- data/dependencies/SDL/include/SDL3/SDL_init.h +508 -0
- data/dependencies/SDL/include/SDL3/SDL_intrin.h +410 -0
- data/dependencies/SDL/include/SDL3/SDL_iostream.h +1379 -0
- data/dependencies/SDL/include/SDL3/SDL_joystick.h +1385 -0
- data/dependencies/SDL/include/SDL3/SDL_keyboard.h +615 -0
- data/dependencies/SDL/include/SDL3/SDL_keycode.h +348 -0
- data/dependencies/SDL/include/SDL3/SDL_loadso.h +145 -0
- data/dependencies/SDL/include/{SDL_locale.h → SDL3/SDL_locale.h} +40 -24
- data/dependencies/SDL/include/SDL3/SDL_log.h +541 -0
- data/dependencies/SDL/include/SDL3/SDL_main.h +704 -0
- data/dependencies/SDL/include/SDL3/SDL_main_impl.h +149 -0
- data/dependencies/SDL/include/{SDL_messagebox.h → SDL3/SDL_messagebox.h} +85 -48
- data/dependencies/SDL/include/{SDL_metal.h → SDL3/SDL_metal.h} +29 -29
- data/dependencies/SDL/include/{SDL_misc.h → SDL3/SDL_misc.h} +13 -12
- data/dependencies/SDL/include/SDL3/SDL_mouse.h +813 -0
- data/dependencies/SDL/include/SDL3/SDL_mutex.h +1117 -0
- data/dependencies/SDL/include/SDL3/SDL_oldnames.h +1339 -0
- data/dependencies/SDL/include/{SDL_opengl.h → SDL3/SDL_opengl.h} +1247 -278
- data/dependencies/SDL/include/{SDL_opengl_glext.h → SDL3/SDL_opengl_glext.h} +5 -1
- data/dependencies/SDL/include/{SDL_opengles.h → SDL3/SDL_opengles.h} +6 -7
- data/dependencies/SDL/include/{SDL_opengles2.h → SDL3/SDL_opengles2.h} +10 -11
- data/dependencies/SDL/include/SDL3/SDL_pen.h +198 -0
- data/dependencies/SDL/include/SDL3/SDL_pixels.h +1441 -0
- data/dependencies/SDL/include/{SDL_test_log.h → SDL3/SDL_platform.h} +25 -26
- data/dependencies/SDL/include/SDL3/SDL_platform_defines.h +497 -0
- data/dependencies/SDL/include/{SDL_power.h → SDL3/SDL_power.h} +40 -20
- data/dependencies/SDL/include/SDL3/SDL_process.h +441 -0
- data/dependencies/SDL/include/SDL3/SDL_properties.h +572 -0
- data/dependencies/SDL/include/SDL3/SDL_rect.h +528 -0
- data/dependencies/SDL/include/SDL3/SDL_render.h +3034 -0
- data/dependencies/SDL/include/SDL3/SDL_revision.h +56 -0
- data/dependencies/SDL/include/{SDL_scancode.h → SDL3/SDL_scancode.h} +60 -68
- data/dependencies/SDL/include/SDL3/SDL_sensor.h +321 -0
- data/dependencies/SDL/include/SDL3/SDL_stdinc.h +6186 -0
- data/dependencies/SDL/include/SDL3/SDL_storage.h +686 -0
- data/dependencies/SDL/include/SDL3/SDL_surface.h +1769 -0
- data/dependencies/SDL/include/SDL3/SDL_system.h +840 -0
- data/dependencies/SDL/include/{SDL_test.h → SDL3/SDL_test.h} +16 -22
- data/dependencies/SDL/include/{SDL_test_assert.h → SDL3/SDL_test_assert.h} +27 -34
- data/dependencies/SDL/include/{SDL_test_common.h → SDL3/SDL_test_common.h} +109 -52
- data/dependencies/SDL/include/{SDL_test_compare.h → SDL3/SDL_test_compare.h} +22 -14
- data/dependencies/SDL/include/{SDL_test_crc32.h → SDL3/SDL_test_crc32.h} +27 -30
- data/dependencies/SDL/include/{SDL_test_font.h → SDL3/SDL_test_font.h} +50 -49
- data/dependencies/SDL/include/{SDL_test_fuzzer.h → SDL3/SDL_test_fuzzer.h} +64 -79
- data/dependencies/SDL/include/{SDL_test_harness.h → SDL3/SDL_test_harness.h} +47 -30
- data/dependencies/SDL/include/SDL3/SDL_test_log.h +83 -0
- data/dependencies/SDL/include/{SDL_test_md5.h → SDL3/SDL_test_md5.h} +21 -28
- data/dependencies/SDL/include/{SDL_test_memory.h → SDL3/SDL_test_memory.h} +19 -16
- data/dependencies/SDL/include/SDL3/SDL_thread.h +602 -0
- data/dependencies/SDL/include/SDL3/SDL_time.h +249 -0
- data/dependencies/SDL/include/SDL3/SDL_timer.h +454 -0
- data/dependencies/SDL/include/SDL3/SDL_touch.h +184 -0
- data/dependencies/SDL/include/SDL3/SDL_tray.h +544 -0
- data/dependencies/SDL/include/SDL3/SDL_version.h +198 -0
- data/dependencies/SDL/include/SDL3/SDL_video.h +3497 -0
- data/dependencies/SDL/include/SDL3/SDL_vulkan.h +287 -0
- data/dependencies/SDL/lib/x64/libSDL3.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL3.dll.a +0 -0
- data/dependencies/SDL_sound/SDL3_sound/SDL_sound.h +755 -0
- data/dependencies/SDL_sound/SDL_sound.c +136 -215
- data/dependencies/SDL_sound/SDL_sound_aiff.c +55 -54
- data/dependencies/SDL_sound/SDL_sound_au.c +32 -32
- data/dependencies/SDL_sound/SDL_sound_coreaudio.c +24 -41
- data/dependencies/SDL_sound/SDL_sound_flac.c +32 -12
- data/dependencies/SDL_sound/SDL_sound_internal.h +33 -48
- data/dependencies/SDL_sound/SDL_sound_modplug.c +21 -29
- data/dependencies/SDL_sound/SDL_sound_mp3.c +35 -13
- data/dependencies/SDL_sound/SDL_sound_raw.c +14 -15
- data/dependencies/SDL_sound/SDL_sound_shn.c +82 -82
- data/dependencies/SDL_sound/SDL_sound_voc.c +30 -30
- data/dependencies/SDL_sound/SDL_sound_vorbis.c +34 -25
- data/dependencies/SDL_sound/SDL_sound_wav.c +86 -82
- data/dependencies/SDL_sound/dr_flac.h +1890 -1301
- data/dependencies/SDL_sound/dr_mp3.h +1098 -660
- data/dependencies/SDL_sound/libmodplug/fastmix.c +1 -1
- data/dependencies/SDL_sound/libmodplug/libmodplug.h +5 -4
- data/dependencies/SDL_sound/libmodplug/load_ams.c +6 -3
- data/dependencies/SDL_sound/libmodplug/load_dsm.c +2 -1
- data/dependencies/SDL_sound/libmodplug/load_mt2.c +2 -2
- data/dependencies/SDL_sound/libmodplug/modplug.h +2 -1
- data/dependencies/SDL_sound/libmodplug/snd_fx.c +3 -3
- data/dependencies/SDL_sound/libmodplug/sndfile.c +3 -0
- data/dependencies/SDL_sound/libmodplug/sndmix.c +7 -3
- data/dependencies/SDL_sound/stb_vorbis.h +397 -342
- data/dependencies/mojoAL/AL/alc.h +2 -2
- data/dependencies/mojoAL/mojoal.c +2120 -1885
- data/dependencies/stb/stb_image.h +1190 -1379
- data/dependencies/stb/stb_image_write.h +329 -129
- data/dependencies/stb/stb_truetype.h +304 -60
- data/dependencies/utf8proc/utf8proc.c +133 -75
- data/dependencies/utf8proc/utf8proc.h +131 -50
- data/dependencies/utf8proc/utf8proc_data.h +16213 -15658
- data/ext/gosu-ffi/extconf.rb +103 -0
- data/ext/gosu-ffi/gosu-ffi.def +467 -0
- data/ffi/Gosu.cpp +330 -0
- data/ffi/Gosu.h +84 -0
- data/ffi/Gosu_Channel.cpp +62 -0
- data/ffi/Gosu_Channel.h +17 -0
- data/ffi/Gosu_Color.cpp +176 -0
- data/ffi/Gosu_Color.h +31 -0
- data/ffi/Gosu_Constants.cpp +334 -0
- data/ffi/Gosu_FFI.h +34 -0
- data/ffi/Gosu_FFI_internal.h +160 -0
- data/ffi/Gosu_Font.cpp +97 -0
- data/ffi/Gosu_Font.h +32 -0
- data/ffi/Gosu_Image.cpp +239 -0
- data/ffi/Gosu_Image.h +71 -0
- data/ffi/Gosu_Sample.cpp +29 -0
- data/ffi/Gosu_Sample.h +14 -0
- data/ffi/Gosu_Song.cpp +69 -0
- data/ffi/Gosu_Song.h +18 -0
- data/ffi/Gosu_TextInput.cpp +94 -0
- data/ffi/Gosu_TextInput.h +25 -0
- data/ffi/Gosu_Window.cpp +314 -0
- data/ffi/Gosu_Window.h +78 -0
- data/include/Gosu/Audio.hpp +6 -11
- data/include/Gosu/Bitmap.hpp +38 -53
- data/include/Gosu/Buffer.hpp +54 -0
- data/include/Gosu/Color.hpp +29 -36
- data/include/Gosu/Directories.hpp +25 -28
- data/include/Gosu/Drawable.hpp +58 -0
- data/include/Gosu/Font.hpp +6 -5
- data/include/Gosu/Fwd.hpp +4 -6
- data/include/Gosu/Gosu.hpp +5 -5
- data/include/Gosu/Graphics.hpp +53 -61
- data/include/Gosu/GraphicsBase.hpp +1 -11
- data/include/Gosu/Image.hpp +12 -15
- data/include/Gosu/Math.hpp +50 -72
- data/include/Gosu/Transform.hpp +32 -0
- data/include/Gosu/Utility.hpp +77 -1
- data/include/Gosu/Version.hpp +2 -2
- data/include/Gosu/Window.hpp +15 -9
- data/lib/SDL3.dll +0 -0
- data/lib/gosu/channel.rb +50 -0
- data/lib/gosu/color.rb +173 -0
- data/lib/gosu/compat.rb +130 -17
- data/lib/gosu/constants.rb +386 -0
- data/lib/gosu/ffi.rb +269 -0
- data/lib/gosu/font.rb +62 -0
- data/lib/gosu/gl_tex_info.rb +33 -0
- data/lib/gosu/gosu.rb +250 -0
- data/lib/gosu/image.rb +179 -0
- data/lib/gosu/numeric.rb +17 -0
- data/lib/gosu/preview.rb +6 -6
- data/lib/gosu/sample.rb +25 -0
- data/lib/gosu/song.rb +57 -0
- data/lib/gosu/text_input.rb +83 -0
- data/lib/gosu/window.rb +249 -0
- data/lib/gosu.rb +29 -8
- data/lib64/SDL3.dll +0 -0
- data/rdoc/gosu.rb +2 -2
- data/src/Audio.cpp +30 -24
- data/src/AudioFile.hpp +5 -4
- data/src/AudioFileAudioToolbox.cpp +8 -8
- data/src/AudioFileSDLSound.cpp +12 -15
- data/src/BinPacker.cpp +188 -0
- data/src/BinPacker.hpp +55 -0
- data/src/Bitmap.cpp +172 -143
- data/src/BitmapIO.cpp +60 -86
- data/src/Buffer.cpp +150 -0
- data/src/ClipRectStack.cpp +38 -0
- data/src/ClipRectStack.hpp +17 -83
- data/src/Color.cpp +75 -80
- data/src/Directories.cpp +47 -0
- data/src/DirectoriesUIKit.cpp +50 -0
- data/src/DrawOp.hpp +20 -18
- data/src/DrawOpQueue.hpp +27 -33
- data/src/Drawable.cpp +95 -0
- data/src/EmptyDrawable.hpp +38 -0
- data/src/FPS.cpp +31 -0
- data/src/Font.cpp +104 -74
- data/src/GosuGLView.cpp +13 -11
- data/src/GosuViewController.cpp +2 -10
- data/src/Graphics.cpp +86 -145
- data/src/GraphicsImpl.hpp +14 -68
- data/src/Image.cpp +41 -35
- data/src/Input.cpp +73 -78
- data/src/Macro.cpp +46 -29
- data/src/Macro.hpp +23 -17
- data/src/MarkupParser.cpp +5 -5
- data/src/Math.cpp +48 -22
- data/src/OffScreenTarget.cpp +47 -50
- data/src/OffScreenTarget.hpp +13 -11
- data/src/OpenGLContext.cpp +116 -0
- data/src/OpenGLContext.hpp +41 -0
- data/src/RenderState.hpp +49 -71
- data/src/Resolution.cpp +65 -53
- data/src/TexChunk.cpp +35 -80
- data/src/TexChunk.hpp +44 -35
- data/src/Text.cpp +1 -1
- data/src/TextBuilder.cpp +35 -21
- data/src/TextBuilder.hpp +6 -9
- data/src/TextInput.cpp +9 -9
- data/src/Texture.cpp +62 -80
- data/src/Texture.hpp +25 -23
- data/src/TiledDrawable.cpp +149 -0
- data/src/TiledDrawable.hpp +47 -0
- data/src/TimingApple.cpp +1 -1
- data/src/Transform.cpp +45 -50
- data/src/TransformStack.hpp +16 -16
- data/src/TrueTypeFont.cpp +59 -51
- data/src/TrueTypeFont.hpp +6 -7
- data/src/TrueTypeFontApple.cpp +28 -19
- data/src/TrueTypeFontUnix.cpp +39 -32
- data/src/TrueTypeFontWin.cpp +30 -30
- data/src/Utility.cpp +113 -37
- data/src/UtilityWin.cpp +49 -0
- data/src/Window.cpp +121 -151
- data/src/WindowUIKit.cpp +14 -14
- metadata +165 -118
- data/dependencies/SDL/include/SDL.h +0 -233
- data/dependencies/SDL/include/SDL_assert.h +0 -320
- data/dependencies/SDL/include/SDL_atomic.h +0 -415
- data/dependencies/SDL/include/SDL_audio.h +0 -1500
- data/dependencies/SDL/include/SDL_clipboard.h +0 -141
- data/dependencies/SDL/include/SDL_config.h +0 -331
- data/dependencies/SDL/include/SDL_cpuinfo.h +0 -594
- data/dependencies/SDL/include/SDL_endian.h +0 -348
- data/dependencies/SDL/include/SDL_error.h +0 -163
- data/dependencies/SDL/include/SDL_events.h +0 -1166
- data/dependencies/SDL/include/SDL_filesystem.h +0 -149
- data/dependencies/SDL/include/SDL_gamecontroller.h +0 -1074
- data/dependencies/SDL/include/SDL_gesture.h +0 -117
- data/dependencies/SDL/include/SDL_guid.h +0 -100
- data/dependencies/SDL/include/SDL_haptic.h +0 -1341
- data/dependencies/SDL/include/SDL_hidapi.h +0 -451
- data/dependencies/SDL/include/SDL_hints.h +0 -2569
- data/dependencies/SDL/include/SDL_joystick.h +0 -1066
- data/dependencies/SDL/include/SDL_keyboard.h +0 -353
- data/dependencies/SDL/include/SDL_keycode.h +0 -358
- data/dependencies/SDL/include/SDL_loadso.h +0 -115
- data/dependencies/SDL/include/SDL_log.h +0 -404
- data/dependencies/SDL/include/SDL_main.h +0 -275
- data/dependencies/SDL/include/SDL_mouse.h +0 -465
- data/dependencies/SDL/include/SDL_mutex.h +0 -471
- data/dependencies/SDL/include/SDL_name.h +0 -33
- data/dependencies/SDL/include/SDL_pixels.h +0 -644
- data/dependencies/SDL/include/SDL_platform.h +0 -261
- data/dependencies/SDL/include/SDL_quit.h +0 -58
- data/dependencies/SDL/include/SDL_rect.h +0 -376
- data/dependencies/SDL/include/SDL_render.h +0 -1919
- data/dependencies/SDL/include/SDL_revision.h +0 -7
- data/dependencies/SDL/include/SDL_rwops.h +0 -841
- data/dependencies/SDL/include/SDL_sensor.h +0 -322
- data/dependencies/SDL/include/SDL_shape.h +0 -155
- data/dependencies/SDL/include/SDL_stdinc.h +0 -830
- data/dependencies/SDL/include/SDL_surface.h +0 -997
- data/dependencies/SDL/include/SDL_system.h +0 -623
- data/dependencies/SDL/include/SDL_syswm.h +0 -386
- data/dependencies/SDL/include/SDL_test_images.h +0 -78
- data/dependencies/SDL/include/SDL_test_random.h +0 -115
- data/dependencies/SDL/include/SDL_thread.h +0 -464
- data/dependencies/SDL/include/SDL_timer.h +0 -222
- data/dependencies/SDL/include/SDL_touch.h +0 -150
- data/dependencies/SDL/include/SDL_version.h +0 -204
- data/dependencies/SDL/include/SDL_video.h +0 -2150
- data/dependencies/SDL/include/SDL_vulkan.h +0 -215
- data/dependencies/SDL/include/begin_code.h +0 -187
- data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
- data/dependencies/SDL_sound/SDL_sound.h +0 -725
- data/ext/gosu/extconf.rb +0 -119
- data/include/Gosu/IO.hpp +0 -254
- data/include/Gosu/ImageData.hpp +0 -53
- data/include/Gosu/Inspection.hpp +0 -7
- data/lib/SDL2.dll +0 -0
- data/lib/gosu/patches.rb +0 -66
- data/lib/gosu/run.rb +0 -20
- data/lib/gosu/swig_patches.rb +0 -110
- data/lib64/SDL2.dll +0 -0
- data/src/BlockAllocator.cpp +0 -131
- data/src/BlockAllocator.hpp +0 -32
- data/src/DirectoriesApple.cpp +0 -69
- data/src/DirectoriesUnix.cpp +0 -46
- data/src/DirectoriesWin.cpp +0 -65
- data/src/EmptyImageData.hpp +0 -52
- data/src/FileUnix.cpp +0 -99
- data/src/FileWin.cpp +0 -88
- data/src/IO.cpp +0 -60
- data/src/Iconv.hpp +0 -51
- data/src/Inspection.cpp +0 -27
- data/src/LargeImageData.cpp +0 -215
- data/src/LargeImageData.hpp +0 -39
- data/src/Log.hpp +0 -19
- data/src/RubyGosu.cxx +0 -13100
- data/src/RubyGosu.h +0 -49
- data/src/WinUtility.cpp +0 -61
- data/src/WinUtility.hpp +0 -27
- /data/dependencies/SDL/include/{SDL_opengles2_gl2.h → SDL3/SDL_opengles2_gl2.h} +0 -0
- /data/dependencies/SDL/include/{SDL_opengles2_gl2ext.h → SDL3/SDL_opengles2_gl2ext.h} +0 -0
- /data/dependencies/SDL/include/{SDL_opengles2_gl2platform.h → SDL3/SDL_opengles2_gl2platform.h} +0 -0
- /data/dependencies/SDL/include/{SDL_opengles2_khrplatform.h → SDL3/SDL_opengles2_khrplatform.h} +0 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
#include "Gosu_FFI_internal.h"
|
|
2
|
+
|
|
3
|
+
GOSU_FFI_API const char* Gosu_version()
|
|
4
|
+
{
|
|
5
|
+
return Gosu::VERSION.c_str();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
GOSU_FFI_API const char* Gosu_licenses()
|
|
9
|
+
{
|
|
10
|
+
return Gosu::LICENSES.c_str();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
GOSU_FFI_API const unsigned Gosu_MAJOR_VERSION = GOSU_MAJOR_VERSION;
|
|
14
|
+
GOSU_FFI_API const unsigned Gosu_MINOR_VERSION = GOSU_MINOR_VERSION;
|
|
15
|
+
GOSU_FFI_API const unsigned Gosu_POINT_VERSION = GOSU_POINT_VERSION;
|
|
16
|
+
|
|
17
|
+
// Window Flags
|
|
18
|
+
GOSU_FFI_API const unsigned Gosu_WF_WINDOWED = Gosu::WF_WINDOWED;
|
|
19
|
+
GOSU_FFI_API const unsigned Gosu_WF_FULLSCREEN = Gosu::WF_FULLSCREEN;
|
|
20
|
+
GOSU_FFI_API const unsigned Gosu_WF_RESIZABLE = Gosu::WF_RESIZABLE;
|
|
21
|
+
GOSU_FFI_API const unsigned Gosu_WF_BORDERLESS = Gosu::WF_BORDERLESS;
|
|
22
|
+
|
|
23
|
+
// Blend Modes
|
|
24
|
+
GOSU_FFI_API const unsigned Gosu_BM_DEFAULT = Gosu::BM_DEFAULT;
|
|
25
|
+
GOSU_FFI_API const unsigned Gosu_BM_INTERPOLATE = Gosu::BM_INTERPOLATE;
|
|
26
|
+
GOSU_FFI_API const unsigned Gosu_BM_ADD = Gosu::BM_ADD;
|
|
27
|
+
GOSU_FFI_API const unsigned Gosu_BM_MULTIPLY = Gosu::BM_MULTIPLY;
|
|
28
|
+
|
|
29
|
+
// Font Flags
|
|
30
|
+
GOSU_FFI_API const unsigned Gosu_FF_BOLD = Gosu::FF_BOLD;
|
|
31
|
+
GOSU_FFI_API const unsigned Gosu_FF_ITALIC = Gosu::FF_ITALIC;
|
|
32
|
+
GOSU_FFI_API const unsigned Gosu_FF_UNDERLINE = Gosu::FF_UNDERLINE;
|
|
33
|
+
GOSU_FFI_API const unsigned Gosu_FF_COMBINATIONS = Gosu::FF_COMBINATIONS;
|
|
34
|
+
|
|
35
|
+
// Alignment
|
|
36
|
+
GOSU_FFI_API const unsigned Gosu_AL_LEFT = Gosu::AL_LEFT;
|
|
37
|
+
GOSU_FFI_API const unsigned Gosu_AL_RIGHT = Gosu::AL_RIGHT;
|
|
38
|
+
GOSU_FFI_API const unsigned Gosu_AL_CENTER = Gosu::AL_CENTER;
|
|
39
|
+
GOSU_FFI_API const unsigned Gosu_AL_JUSTIFY = Gosu::AL_JUSTIFY;
|
|
40
|
+
|
|
41
|
+
// Image Flags
|
|
42
|
+
GOSU_FFI_API const unsigned Gosu_IF_SMOOTH = Gosu::IF_SMOOTH;
|
|
43
|
+
GOSU_FFI_API const unsigned Gosu_IF_TILEABLE_LEFT = Gosu::IF_TILEABLE_LEFT;
|
|
44
|
+
GOSU_FFI_API const unsigned Gosu_IF_TILEABLE_TOP = Gosu::IF_TILEABLE_TOP;
|
|
45
|
+
GOSU_FFI_API const unsigned Gosu_IF_TILEABLE_RIGHT = Gosu::IF_TILEABLE_RIGHT;
|
|
46
|
+
GOSU_FFI_API const unsigned Gosu_IF_TILEABLE_BOTTOM = Gosu::IF_TILEABLE_BOTTOM;
|
|
47
|
+
GOSU_FFI_API const unsigned Gosu_IF_TILEABLE = Gosu::IF_TILEABLE;
|
|
48
|
+
GOSU_FFI_API const unsigned Gosu_IF_RETRO = Gosu::IF_RETRO;
|
|
49
|
+
|
|
50
|
+
GOSU_FFI_API const unsigned Gosu_KB_ESCAPE = Gosu::KB_ESCAPE;
|
|
51
|
+
GOSU_FFI_API const unsigned Gosu_KB_F1 = Gosu::KB_F1;
|
|
52
|
+
GOSU_FFI_API const unsigned Gosu_KB_F2 = Gosu::KB_F2;
|
|
53
|
+
GOSU_FFI_API const unsigned Gosu_KB_F3 = Gosu::KB_F3;
|
|
54
|
+
GOSU_FFI_API const unsigned Gosu_KB_F4 = Gosu::KB_F4;
|
|
55
|
+
GOSU_FFI_API const unsigned Gosu_KB_F5 = Gosu::KB_F5;
|
|
56
|
+
GOSU_FFI_API const unsigned Gosu_KB_F6 = Gosu::KB_F6;
|
|
57
|
+
GOSU_FFI_API const unsigned Gosu_KB_F7 = Gosu::KB_F7;
|
|
58
|
+
GOSU_FFI_API const unsigned Gosu_KB_F8 = Gosu::KB_F8;
|
|
59
|
+
GOSU_FFI_API const unsigned Gosu_KB_F9 = Gosu::KB_F9;
|
|
60
|
+
GOSU_FFI_API const unsigned Gosu_KB_F10 = Gosu::KB_F10;
|
|
61
|
+
GOSU_FFI_API const unsigned Gosu_KB_F11 = Gosu::KB_F11;
|
|
62
|
+
GOSU_FFI_API const unsigned Gosu_KB_F12 = Gosu::KB_F12;
|
|
63
|
+
GOSU_FFI_API const unsigned Gosu_KB_0 = Gosu::KB_0;
|
|
64
|
+
GOSU_FFI_API const unsigned Gosu_KB_1 = Gosu::KB_1;
|
|
65
|
+
GOSU_FFI_API const unsigned Gosu_KB_2 = Gosu::KB_2;
|
|
66
|
+
GOSU_FFI_API const unsigned Gosu_KB_3 = Gosu::KB_3;
|
|
67
|
+
GOSU_FFI_API const unsigned Gosu_KB_4 = Gosu::KB_4;
|
|
68
|
+
GOSU_FFI_API const unsigned Gosu_KB_5 = Gosu::KB_5;
|
|
69
|
+
GOSU_FFI_API const unsigned Gosu_KB_6 = Gosu::KB_6;
|
|
70
|
+
GOSU_FFI_API const unsigned Gosu_KB_7 = Gosu::KB_7;
|
|
71
|
+
GOSU_FFI_API const unsigned Gosu_KB_8 = Gosu::KB_8;
|
|
72
|
+
GOSU_FFI_API const unsigned Gosu_KB_9 = Gosu::KB_9;
|
|
73
|
+
GOSU_FFI_API const unsigned Gosu_KB_TAB = Gosu::KB_TAB;
|
|
74
|
+
GOSU_FFI_API const unsigned Gosu_KB_RETURN = Gosu::KB_RETURN;
|
|
75
|
+
GOSU_FFI_API const unsigned Gosu_KB_SPACE = Gosu::KB_SPACE;
|
|
76
|
+
GOSU_FFI_API const unsigned Gosu_KB_LEFT_SHIFT = Gosu::KB_LEFT_SHIFT;
|
|
77
|
+
GOSU_FFI_API const unsigned Gosu_KB_RIGHT_SHIFT = Gosu::KB_RIGHT_SHIFT;
|
|
78
|
+
GOSU_FFI_API const unsigned Gosu_KB_LEFT_CONTROL = Gosu::KB_LEFT_CONTROL;
|
|
79
|
+
GOSU_FFI_API const unsigned Gosu_KB_RIGHT_CONTROL = Gosu::KB_RIGHT_CONTROL;
|
|
80
|
+
GOSU_FFI_API const unsigned Gosu_KB_LEFT_ALT = Gosu::KB_LEFT_ALT;
|
|
81
|
+
GOSU_FFI_API const unsigned Gosu_KB_RIGHT_ALT = Gosu::KB_RIGHT_ALT;
|
|
82
|
+
GOSU_FFI_API const unsigned Gosu_KB_LEFT_META = Gosu::KB_LEFT_META;
|
|
83
|
+
GOSU_FFI_API const unsigned Gosu_KB_RIGHT_META = Gosu::KB_RIGHT_META;
|
|
84
|
+
GOSU_FFI_API const unsigned Gosu_KB_BACKSPACE = Gosu::KB_BACKSPACE;
|
|
85
|
+
GOSU_FFI_API const unsigned Gosu_KB_LEFT = Gosu::KB_LEFT;
|
|
86
|
+
GOSU_FFI_API const unsigned Gosu_KB_RIGHT = Gosu::KB_RIGHT;
|
|
87
|
+
GOSU_FFI_API const unsigned Gosu_KB_UP = Gosu::KB_UP;
|
|
88
|
+
GOSU_FFI_API const unsigned Gosu_KB_DOWN = Gosu::KB_DOWN;
|
|
89
|
+
GOSU_FFI_API const unsigned Gosu_KB_HOME = Gosu::KB_HOME;
|
|
90
|
+
GOSU_FFI_API const unsigned Gosu_KB_END = Gosu::KB_END;
|
|
91
|
+
GOSU_FFI_API const unsigned Gosu_KB_PRINT_SCREEN = Gosu::KB_PRINT_SCREEN;
|
|
92
|
+
GOSU_FFI_API const unsigned Gosu_KB_SCROLL_LOCK = Gosu::KB_SCROLL_LOCK;
|
|
93
|
+
GOSU_FFI_API const unsigned Gosu_KB_PAUSE = Gosu::KB_PAUSE;
|
|
94
|
+
GOSU_FFI_API const unsigned Gosu_KB_INSERT = Gosu::KB_INSERT;
|
|
95
|
+
GOSU_FFI_API const unsigned Gosu_KB_DELETE = Gosu::KB_DELETE;
|
|
96
|
+
GOSU_FFI_API const unsigned Gosu_KB_PAGE_UP = Gosu::KB_PAGE_UP;
|
|
97
|
+
GOSU_FFI_API const unsigned Gosu_KB_PAGE_DOWN = Gosu::KB_PAGE_DOWN;
|
|
98
|
+
GOSU_FFI_API const unsigned Gosu_KB_ENTER = Gosu::KB_ENTER;
|
|
99
|
+
GOSU_FFI_API const unsigned Gosu_KB_BACKTICK = Gosu::KB_BACKTICK;
|
|
100
|
+
GOSU_FFI_API const unsigned Gosu_KB_MINUS = Gosu::KB_MINUS;
|
|
101
|
+
GOSU_FFI_API const unsigned Gosu_KB_EQUALS = Gosu::KB_EQUALS;
|
|
102
|
+
GOSU_FFI_API const unsigned Gosu_KB_LEFT_BRACKET = Gosu::KB_LEFT_BRACKET;
|
|
103
|
+
GOSU_FFI_API const unsigned Gosu_KB_RIGHT_BRACKET = Gosu::KB_RIGHT_BRACKET;
|
|
104
|
+
GOSU_FFI_API const unsigned Gosu_KB_BACKSLASH = Gosu::KB_BACKSLASH;
|
|
105
|
+
GOSU_FFI_API const unsigned Gosu_KB_SEMICOLON = Gosu::KB_SEMICOLON;
|
|
106
|
+
GOSU_FFI_API const unsigned Gosu_KB_APOSTROPHE = Gosu::KB_APOSTROPHE;
|
|
107
|
+
GOSU_FFI_API const unsigned Gosu_KB_COMMA = Gosu::KB_COMMA;
|
|
108
|
+
GOSU_FFI_API const unsigned Gosu_KB_PERIOD = Gosu::KB_PERIOD;
|
|
109
|
+
GOSU_FFI_API const unsigned Gosu_KB_SLASH = Gosu::KB_SLASH;
|
|
110
|
+
GOSU_FFI_API const unsigned Gosu_KB_CAPS_LOCK = Gosu::KB_CAPS_LOCK;
|
|
111
|
+
GOSU_FFI_API const unsigned Gosu_KB_A = Gosu::KB_A;
|
|
112
|
+
GOSU_FFI_API const unsigned Gosu_KB_B = Gosu::KB_B;
|
|
113
|
+
GOSU_FFI_API const unsigned Gosu_KB_C = Gosu::KB_C;
|
|
114
|
+
GOSU_FFI_API const unsigned Gosu_KB_D = Gosu::KB_D;
|
|
115
|
+
GOSU_FFI_API const unsigned Gosu_KB_E = Gosu::KB_E;
|
|
116
|
+
GOSU_FFI_API const unsigned Gosu_KB_F = Gosu::KB_F;
|
|
117
|
+
GOSU_FFI_API const unsigned Gosu_KB_G = Gosu::KB_G;
|
|
118
|
+
GOSU_FFI_API const unsigned Gosu_KB_H = Gosu::KB_H;
|
|
119
|
+
GOSU_FFI_API const unsigned Gosu_KB_I = Gosu::KB_I;
|
|
120
|
+
GOSU_FFI_API const unsigned Gosu_KB_J = Gosu::KB_J;
|
|
121
|
+
GOSU_FFI_API const unsigned Gosu_KB_K = Gosu::KB_K;
|
|
122
|
+
GOSU_FFI_API const unsigned Gosu_KB_L = Gosu::KB_L;
|
|
123
|
+
GOSU_FFI_API const unsigned Gosu_KB_M = Gosu::KB_M;
|
|
124
|
+
GOSU_FFI_API const unsigned Gosu_KB_N = Gosu::KB_N;
|
|
125
|
+
GOSU_FFI_API const unsigned Gosu_KB_O = Gosu::KB_O;
|
|
126
|
+
GOSU_FFI_API const unsigned Gosu_KB_P = Gosu::KB_P;
|
|
127
|
+
GOSU_FFI_API const unsigned Gosu_KB_Q = Gosu::KB_Q;
|
|
128
|
+
GOSU_FFI_API const unsigned Gosu_KB_R = Gosu::KB_R;
|
|
129
|
+
GOSU_FFI_API const unsigned Gosu_KB_S = Gosu::KB_S;
|
|
130
|
+
GOSU_FFI_API const unsigned Gosu_KB_T = Gosu::KB_T;
|
|
131
|
+
GOSU_FFI_API const unsigned Gosu_KB_U = Gosu::KB_U;
|
|
132
|
+
GOSU_FFI_API const unsigned Gosu_KB_V = Gosu::KB_V;
|
|
133
|
+
GOSU_FFI_API const unsigned Gosu_KB_W = Gosu::KB_W;
|
|
134
|
+
GOSU_FFI_API const unsigned Gosu_KB_X = Gosu::KB_X;
|
|
135
|
+
GOSU_FFI_API const unsigned Gosu_KB_Y = Gosu::KB_Y;
|
|
136
|
+
GOSU_FFI_API const unsigned Gosu_KB_Z = Gosu::KB_Z;
|
|
137
|
+
GOSU_FFI_API const unsigned Gosu_KB_ISO = Gosu::KB_ISO;
|
|
138
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_0 = Gosu::KB_NUMPAD_0;
|
|
139
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_1 = Gosu::KB_NUMPAD_1;
|
|
140
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_2 = Gosu::KB_NUMPAD_2;
|
|
141
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_3 = Gosu::KB_NUMPAD_3;
|
|
142
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_4 = Gosu::KB_NUMPAD_4;
|
|
143
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_5 = Gosu::KB_NUMPAD_5;
|
|
144
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_6 = Gosu::KB_NUMPAD_6;
|
|
145
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_7 = Gosu::KB_NUMPAD_7;
|
|
146
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_8 = Gosu::KB_NUMPAD_8;
|
|
147
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_9 = Gosu::KB_NUMPAD_9;
|
|
148
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_DELETE = Gosu::KB_NUMPAD_DELETE;
|
|
149
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_PLUS = Gosu::KB_NUMPAD_PLUS;
|
|
150
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_MINUS = Gosu::KB_NUMPAD_MINUS;
|
|
151
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_MULTIPLY = Gosu::KB_NUMPAD_MULTIPLY;
|
|
152
|
+
GOSU_FFI_API const unsigned Gosu_KB_NUMPAD_DIVIDE = Gosu::KB_NUMPAD_DIVIDE;
|
|
153
|
+
|
|
154
|
+
GOSU_FFI_API const unsigned Gosu_MS_LEFT = Gosu::MS_LEFT;
|
|
155
|
+
GOSU_FFI_API const unsigned Gosu_MS_MIDDLE = Gosu::MS_MIDDLE;
|
|
156
|
+
GOSU_FFI_API const unsigned Gosu_MS_RIGHT = Gosu::MS_RIGHT;
|
|
157
|
+
GOSU_FFI_API const unsigned Gosu_MS_WHEEL_UP = Gosu::MS_WHEEL_UP;
|
|
158
|
+
GOSU_FFI_API const unsigned Gosu_MS_WHEEL_DOWN = Gosu::MS_WHEEL_DOWN;
|
|
159
|
+
GOSU_FFI_API const unsigned Gosu_MS_OTHER_0 = Gosu::MS_OTHER_0;
|
|
160
|
+
GOSU_FFI_API const unsigned Gosu_MS_OTHER_1 = Gosu::MS_OTHER_1;
|
|
161
|
+
GOSU_FFI_API const unsigned Gosu_MS_OTHER_2 = Gosu::MS_OTHER_2;
|
|
162
|
+
GOSU_FFI_API const unsigned Gosu_MS_OTHER_3 = Gosu::MS_OTHER_3;
|
|
163
|
+
GOSU_FFI_API const unsigned Gosu_MS_OTHER_4 = Gosu::MS_OTHER_4;
|
|
164
|
+
GOSU_FFI_API const unsigned Gosu_MS_OTHER_5 = Gosu::MS_OTHER_5;
|
|
165
|
+
GOSU_FFI_API const unsigned Gosu_MS_OTHER_6 = Gosu::MS_OTHER_6;
|
|
166
|
+
GOSU_FFI_API const unsigned Gosu_MS_OTHER_7 = Gosu::MS_OTHER_7;
|
|
167
|
+
|
|
168
|
+
GOSU_FFI_API const unsigned Gosu_GP_DPAD_LEFT = Gosu::GP_DPAD_LEFT;
|
|
169
|
+
GOSU_FFI_API const unsigned Gosu_GP_DPAD_RIGHT = Gosu::GP_DPAD_RIGHT;
|
|
170
|
+
GOSU_FFI_API const unsigned Gosu_GP_DPAD_UP = Gosu::GP_DPAD_UP;
|
|
171
|
+
GOSU_FFI_API const unsigned Gosu_GP_DPAD_DOWN = Gosu::GP_DPAD_DOWN;
|
|
172
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_0 = Gosu::GP_BUTTON_0;
|
|
173
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_1 = Gosu::GP_BUTTON_1;
|
|
174
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_2 = Gosu::GP_BUTTON_2;
|
|
175
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_3 = Gosu::GP_BUTTON_3;
|
|
176
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_4 = Gosu::GP_BUTTON_4;
|
|
177
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_5 = Gosu::GP_BUTTON_5;
|
|
178
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_6 = Gosu::GP_BUTTON_6;
|
|
179
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_7 = Gosu::GP_BUTTON_7;
|
|
180
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_8 = Gosu::GP_BUTTON_8;
|
|
181
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_9 = Gosu::GP_BUTTON_9;
|
|
182
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_10 = Gosu::GP_BUTTON_10;
|
|
183
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_11 = Gosu::GP_BUTTON_11;
|
|
184
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_12 = Gosu::GP_BUTTON_12;
|
|
185
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_13 = Gosu::GP_BUTTON_13;
|
|
186
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_14 = Gosu::GP_BUTTON_14;
|
|
187
|
+
GOSU_FFI_API const unsigned Gosu_GP_BUTTON_15 = Gosu::GP_BUTTON_15;
|
|
188
|
+
|
|
189
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_DPAD_LEFT = Gosu::GP_0_DPAD_LEFT;
|
|
190
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_DPAD_RIGHT = Gosu::GP_0_DPAD_RIGHT;
|
|
191
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_DPAD_UP = Gosu::GP_0_DPAD_UP;
|
|
192
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_DPAD_DOWN = Gosu::GP_0_DPAD_DOWN;
|
|
193
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_0 = Gosu::GP_0_BUTTON_0;
|
|
194
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_1 = Gosu::GP_0_BUTTON_1;
|
|
195
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_2 = Gosu::GP_0_BUTTON_2;
|
|
196
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_3 = Gosu::GP_0_BUTTON_3;
|
|
197
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_4 = Gosu::GP_0_BUTTON_4;
|
|
198
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_5 = Gosu::GP_0_BUTTON_5;
|
|
199
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_6 = Gosu::GP_0_BUTTON_6;
|
|
200
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_7 = Gosu::GP_0_BUTTON_7;
|
|
201
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_8 = Gosu::GP_0_BUTTON_8;
|
|
202
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_9 = Gosu::GP_0_BUTTON_9;
|
|
203
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_10 = Gosu::GP_0_BUTTON_10;
|
|
204
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_11 = Gosu::GP_0_BUTTON_11;
|
|
205
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_12 = Gosu::GP_0_BUTTON_12;
|
|
206
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_13 = Gosu::GP_0_BUTTON_13;
|
|
207
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_14 = Gosu::GP_0_BUTTON_14;
|
|
208
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_BUTTON_15 = Gosu::GP_0_BUTTON_15;
|
|
209
|
+
|
|
210
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_DPAD_LEFT = Gosu::GP_1_DPAD_LEFT;
|
|
211
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_DPAD_RIGHT = Gosu::GP_1_DPAD_RIGHT;
|
|
212
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_DPAD_UP = Gosu::GP_1_DPAD_UP;
|
|
213
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_DPAD_DOWN = Gosu::GP_1_DPAD_DOWN;
|
|
214
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_0 = Gosu::GP_1_BUTTON_0;
|
|
215
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_1 = Gosu::GP_1_BUTTON_1;
|
|
216
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_2 = Gosu::GP_1_BUTTON_2;
|
|
217
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_3 = Gosu::GP_1_BUTTON_3;
|
|
218
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_4 = Gosu::GP_1_BUTTON_4;
|
|
219
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_5 = Gosu::GP_1_BUTTON_5;
|
|
220
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_6 = Gosu::GP_1_BUTTON_6;
|
|
221
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_7 = Gosu::GP_1_BUTTON_7;
|
|
222
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_8 = Gosu::GP_1_BUTTON_8;
|
|
223
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_9 = Gosu::GP_1_BUTTON_9;
|
|
224
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_10 = Gosu::GP_1_BUTTON_10;
|
|
225
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_11 = Gosu::GP_1_BUTTON_11;
|
|
226
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_12 = Gosu::GP_1_BUTTON_12;
|
|
227
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_13 = Gosu::GP_1_BUTTON_13;
|
|
228
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_14 = Gosu::GP_1_BUTTON_14;
|
|
229
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_BUTTON_15 = Gosu::GP_1_BUTTON_15;
|
|
230
|
+
|
|
231
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_DPAD_LEFT = Gosu::GP_2_DPAD_LEFT;
|
|
232
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_DPAD_RIGHT = Gosu::GP_2_DPAD_RIGHT;
|
|
233
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_DPAD_UP = Gosu::GP_2_DPAD_UP;
|
|
234
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_DPAD_DOWN = Gosu::GP_2_DPAD_DOWN;
|
|
235
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_0 = Gosu::GP_2_BUTTON_0;
|
|
236
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_1 = Gosu::GP_2_BUTTON_1;
|
|
237
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_2 = Gosu::GP_2_BUTTON_2;
|
|
238
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_3 = Gosu::GP_2_BUTTON_3;
|
|
239
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_4 = Gosu::GP_2_BUTTON_4;
|
|
240
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_5 = Gosu::GP_2_BUTTON_5;
|
|
241
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_6 = Gosu::GP_2_BUTTON_6;
|
|
242
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_7 = Gosu::GP_2_BUTTON_7;
|
|
243
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_8 = Gosu::GP_2_BUTTON_8;
|
|
244
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_9 = Gosu::GP_2_BUTTON_9;
|
|
245
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_10 = Gosu::GP_2_BUTTON_10;
|
|
246
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_11 = Gosu::GP_2_BUTTON_11;
|
|
247
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_12 = Gosu::GP_2_BUTTON_12;
|
|
248
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_13 = Gosu::GP_2_BUTTON_13;
|
|
249
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_14 = Gosu::GP_2_BUTTON_14;
|
|
250
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_BUTTON_15 = Gosu::GP_2_BUTTON_15;
|
|
251
|
+
|
|
252
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_DPAD_LEFT = Gosu::GP_3_DPAD_LEFT;
|
|
253
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_DPAD_RIGHT = Gosu::GP_3_DPAD_RIGHT;
|
|
254
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_DPAD_UP = Gosu::GP_3_DPAD_UP;
|
|
255
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_DPAD_DOWN = Gosu::GP_3_DPAD_DOWN;
|
|
256
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_0 = Gosu::GP_3_BUTTON_0;
|
|
257
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_1 = Gosu::GP_3_BUTTON_1;
|
|
258
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_2 = Gosu::GP_3_BUTTON_2;
|
|
259
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_3 = Gosu::GP_3_BUTTON_3;
|
|
260
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_4 = Gosu::GP_3_BUTTON_4;
|
|
261
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_5 = Gosu::GP_3_BUTTON_5;
|
|
262
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_6 = Gosu::GP_3_BUTTON_6;
|
|
263
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_7 = Gosu::GP_3_BUTTON_7;
|
|
264
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_8 = Gosu::GP_3_BUTTON_8;
|
|
265
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_9 = Gosu::GP_3_BUTTON_9;
|
|
266
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_10 = Gosu::GP_3_BUTTON_10;
|
|
267
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_11 = Gosu::GP_3_BUTTON_11;
|
|
268
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_12 = Gosu::GP_3_BUTTON_12;
|
|
269
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_13 = Gosu::GP_3_BUTTON_13;
|
|
270
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_14 = Gosu::GP_3_BUTTON_14;
|
|
271
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_BUTTON_15 = Gosu::GP_3_BUTTON_15;
|
|
272
|
+
|
|
273
|
+
GOSU_FFI_API const unsigned Gosu_GP_LEFT = Gosu::GP_LEFT;
|
|
274
|
+
GOSU_FFI_API const unsigned Gosu_GP_RIGHT = Gosu::GP_RIGHT;
|
|
275
|
+
GOSU_FFI_API const unsigned Gosu_GP_UP = Gosu::GP_UP;
|
|
276
|
+
GOSU_FFI_API const unsigned Gosu_GP_DOWN = Gosu::GP_DOWN;
|
|
277
|
+
|
|
278
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_LEFT = Gosu::GP_0_LEFT;
|
|
279
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_RIGHT = Gosu::GP_0_RIGHT;
|
|
280
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_UP = Gosu::GP_0_UP;
|
|
281
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_DOWN = Gosu::GP_0_DOWN;
|
|
282
|
+
|
|
283
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_LEFT = Gosu::GP_1_LEFT;
|
|
284
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_RIGHT = Gosu::GP_1_RIGHT;
|
|
285
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_UP = Gosu::GP_1_UP;
|
|
286
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_DOWN = Gosu::GP_1_DOWN;
|
|
287
|
+
|
|
288
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_LEFT = Gosu::GP_2_LEFT;
|
|
289
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_RIGHT = Gosu::GP_2_RIGHT;
|
|
290
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_UP = Gosu::GP_2_UP;
|
|
291
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_DOWN = Gosu::GP_2_DOWN;
|
|
292
|
+
|
|
293
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_LEFT = Gosu::GP_3_LEFT;
|
|
294
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_RIGHT = Gosu::GP_3_RIGHT;
|
|
295
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_UP = Gosu::GP_3_UP;
|
|
296
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_DOWN = Gosu::GP_3_DOWN;
|
|
297
|
+
|
|
298
|
+
GOSU_FFI_API const unsigned Gosu_GP_LEFT_STICK_X_AXIS = Gosu::GP_LEFT_STICK_X_AXIS;
|
|
299
|
+
GOSU_FFI_API const unsigned Gosu_GP_LEFT_STICK_Y_AXIS = Gosu::GP_LEFT_STICK_Y_AXIS;
|
|
300
|
+
GOSU_FFI_API const unsigned Gosu_GP_RIGHT_STICK_X_AXIS = Gosu::GP_RIGHT_STICK_X_AXIS;
|
|
301
|
+
GOSU_FFI_API const unsigned Gosu_GP_RIGHT_STICK_Y_AXIS = Gosu::GP_RIGHT_STICK_Y_AXIS;
|
|
302
|
+
GOSU_FFI_API const unsigned Gosu_GP_LEFT_TRIGGER_AXIS = Gosu::GP_LEFT_TRIGGER_AXIS;
|
|
303
|
+
GOSU_FFI_API const unsigned Gosu_GP_RIGHT_TRIGGER_AXIS = Gosu::GP_RIGHT_TRIGGER_AXIS;
|
|
304
|
+
|
|
305
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_LEFT_STICK_X_AXIS = Gosu::GP_0_LEFT_STICK_X_AXIS;
|
|
306
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_LEFT_STICK_Y_AXIS = Gosu::GP_0_LEFT_STICK_Y_AXIS;
|
|
307
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_RIGHT_STICK_X_AXIS = Gosu::GP_0_RIGHT_STICK_X_AXIS;
|
|
308
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_RIGHT_STICK_Y_AXIS = Gosu::GP_0_RIGHT_STICK_Y_AXIS;
|
|
309
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_LEFT_TRIGGER_AXIS = Gosu::GP_0_LEFT_TRIGGER_AXIS;
|
|
310
|
+
GOSU_FFI_API const unsigned Gosu_GP_0_RIGHT_TRIGGER_AXIS = Gosu::GP_0_RIGHT_TRIGGER_AXIS;
|
|
311
|
+
|
|
312
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_LEFT_STICK_X_AXIS = Gosu::GP_1_LEFT_STICK_X_AXIS;
|
|
313
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_LEFT_STICK_Y_AXIS = Gosu::GP_1_LEFT_STICK_Y_AXIS;
|
|
314
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_RIGHT_STICK_X_AXIS = Gosu::GP_1_RIGHT_STICK_X_AXIS;
|
|
315
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_RIGHT_STICK_Y_AXIS = Gosu::GP_1_RIGHT_STICK_Y_AXIS;
|
|
316
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_LEFT_TRIGGER_AXIS = Gosu::GP_1_LEFT_TRIGGER_AXIS;
|
|
317
|
+
GOSU_FFI_API const unsigned Gosu_GP_1_RIGHT_TRIGGER_AXIS = Gosu::GP_1_RIGHT_TRIGGER_AXIS;
|
|
318
|
+
|
|
319
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_LEFT_STICK_X_AXIS = Gosu::GP_2_LEFT_STICK_X_AXIS;
|
|
320
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_LEFT_STICK_Y_AXIS = Gosu::GP_2_LEFT_STICK_Y_AXIS;
|
|
321
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_RIGHT_STICK_X_AXIS = Gosu::GP_2_RIGHT_STICK_X_AXIS;
|
|
322
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_RIGHT_STICK_Y_AXIS = Gosu::GP_2_RIGHT_STICK_Y_AXIS;
|
|
323
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_LEFT_TRIGGER_AXIS = Gosu::GP_2_LEFT_TRIGGER_AXIS;
|
|
324
|
+
GOSU_FFI_API const unsigned Gosu_GP_2_RIGHT_TRIGGER_AXIS = Gosu::GP_2_RIGHT_TRIGGER_AXIS;
|
|
325
|
+
|
|
326
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_LEFT_STICK_X_AXIS = Gosu::GP_3_LEFT_STICK_X_AXIS;
|
|
327
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_LEFT_STICK_Y_AXIS = Gosu::GP_3_LEFT_STICK_Y_AXIS;
|
|
328
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_RIGHT_STICK_X_AXIS = Gosu::GP_3_RIGHT_STICK_X_AXIS;
|
|
329
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_RIGHT_STICK_Y_AXIS = Gosu::GP_3_RIGHT_STICK_Y_AXIS;
|
|
330
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_LEFT_TRIGGER_AXIS = Gosu::GP_3_LEFT_TRIGGER_AXIS;
|
|
331
|
+
GOSU_FFI_API const unsigned Gosu_GP_3_RIGHT_TRIGGER_AXIS = Gosu::GP_3_RIGHT_TRIGGER_AXIS;
|
|
332
|
+
|
|
333
|
+
GOSU_FFI_API const unsigned Gosu_NUM_GAMEPADS = Gosu::NUM_GAMEPADS;
|
|
334
|
+
GOSU_FFI_API const unsigned Gosu_NO_BUTTON = Gosu::NO_BUTTON;
|
data/ffi/Gosu_FFI.h
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
// https://stackoverflow.com/a/2164853
|
|
4
|
+
|
|
5
|
+
// Microsoft
|
|
6
|
+
#if defined(_MSC_VER)
|
|
7
|
+
#define GOSU_FFI_API_EXPORTS __declspec(dllexport)
|
|
8
|
+
#define GOSU_FFI_API_IMPORTS __declspec(dllimport)
|
|
9
|
+
// GCC
|
|
10
|
+
#elif defined(__GNUC__)
|
|
11
|
+
#define GOSU_FFI_API_EXPORTS __attribute__((visibility("default")))
|
|
12
|
+
#define GOSU_FFI_API_IMPORTS
|
|
13
|
+
// Do nothing and hope for the best
|
|
14
|
+
#else
|
|
15
|
+
#define GOSU_FFI_API_EXPORTS
|
|
16
|
+
#define GOSU_FFI_API_IMPORTS
|
|
17
|
+
#pragma warning Unknown dynamic link import/export semantics.
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
#ifdef GOSU_FFI_EXPORTS
|
|
21
|
+
#if defined(MRBGEM_MRUBY_GOSU_VERSION) && !defined(__cplusplus) // Compiling mruby-gosu as C only
|
|
22
|
+
#if defined(_MSC_VER)
|
|
23
|
+
#include <stdbool.h>
|
|
24
|
+
#endif
|
|
25
|
+
#define GOSU_FFI_API GOSU_FFI_API_EXPORTS
|
|
26
|
+
#else
|
|
27
|
+
// When building Gosu, also add [[maybe_unused]] to silence warnings about unused functions.
|
|
28
|
+
#define GOSU_FFI_API extern "C" [[maybe_unused]] GOSU_FFI_API_EXPORTS
|
|
29
|
+
#endif
|
|
30
|
+
#elif defined(__cplusplus)
|
|
31
|
+
#define GOSU_FFI_API extern "C" GOSU_FFI_API_IMPORTS
|
|
32
|
+
#else
|
|
33
|
+
#define GOSU_FFI_API GOSU_FFI_API_IMPORTS
|
|
34
|
+
#endif
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#ifndef __cplusplus
|
|
4
|
+
#error This file is only for internal use within the Gosu FFI implementation.
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#include "Gosu.h"
|
|
8
|
+
#include <Gosu/Gosu.hpp>
|
|
9
|
+
#include <exception>
|
|
10
|
+
#include <functional>
|
|
11
|
+
#include <string>
|
|
12
|
+
|
|
13
|
+
// Error handling
|
|
14
|
+
|
|
15
|
+
std::string& Gosu_internal_error();
|
|
16
|
+
|
|
17
|
+
template<typename Functor>
|
|
18
|
+
auto Gosu_translate_exceptions(Functor functor)
|
|
19
|
+
{
|
|
20
|
+
try {
|
|
21
|
+
// The functor may call back into Ruby, which may in turn call other Gosu methods that fail.
|
|
22
|
+
// If the Ruby callback handles these errors itself, they must not be reported again.
|
|
23
|
+
// => Reset it not only before, but also after the functor.
|
|
24
|
+
Gosu_internal_error().clear();
|
|
25
|
+
const auto clear_again = Gosu::finally([] { Gosu_internal_error().clear(); });
|
|
26
|
+
|
|
27
|
+
return functor();
|
|
28
|
+
}
|
|
29
|
+
catch (const std::exception& e) {
|
|
30
|
+
Gosu_internal_error() = e.what();
|
|
31
|
+
using R = decltype(functor());
|
|
32
|
+
return R();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// C-compatible wrapper structs for Gosu classes. (No inheritance because of missing virtual dtors.)
|
|
37
|
+
|
|
38
|
+
struct Gosu_Channel
|
|
39
|
+
{
|
|
40
|
+
Gosu::Channel channel;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
struct Gosu_Font
|
|
44
|
+
{
|
|
45
|
+
Gosu::Font font;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
struct Gosu_Image
|
|
49
|
+
{
|
|
50
|
+
Gosu::Image image;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
struct Gosu_Sample
|
|
54
|
+
{
|
|
55
|
+
Gosu::Sample sample;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Use inheritance where composition is not feasible (because we want to compare pointers).
|
|
59
|
+
|
|
60
|
+
struct Gosu_Song : Gosu::Song
|
|
61
|
+
{
|
|
62
|
+
using Song::Song;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
struct Gosu_TextInput : public Gosu::TextInput
|
|
66
|
+
{
|
|
67
|
+
std::string filter(std::string text) const override
|
|
68
|
+
{
|
|
69
|
+
if (filter_callback) {
|
|
70
|
+
filter_callback(text.c_str());
|
|
71
|
+
// We now expect the result to be stored using Gosu_TextInput_set_filter_result.
|
|
72
|
+
return filter_result;
|
|
73
|
+
}
|
|
74
|
+
return Gosu::TextInput::filter(text);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
std::function<void(const char* text)> filter_callback;
|
|
78
|
+
std::string filter_result;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
struct Gosu_Window : public Gosu::Window
|
|
82
|
+
{
|
|
83
|
+
using Window::Window;
|
|
84
|
+
|
|
85
|
+
void update() override
|
|
86
|
+
{
|
|
87
|
+
if (update_callback) update_callback();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
void draw() override
|
|
91
|
+
{
|
|
92
|
+
if (draw_callback) draw_callback();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void button_down(Gosu::Button btn) override
|
|
96
|
+
{
|
|
97
|
+
if (button_down_callback) button_down_callback(btn);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
void button_up(Gosu::Button btn) override
|
|
101
|
+
{
|
|
102
|
+
if (button_up_callback) button_up_callback(btn);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
void gamepad_connected(int id) override
|
|
106
|
+
{
|
|
107
|
+
if (gamepad_connected_callback) gamepad_connected_callback(id);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
void gamepad_disconnected(int id) override
|
|
111
|
+
{
|
|
112
|
+
if (gamepad_disconnected_callback) gamepad_disconnected_callback(id);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
void drop(const std::string& filename) override
|
|
116
|
+
{
|
|
117
|
+
if (drop_callback) drop_callback(filename.c_str());
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
bool needs_redraw() const override
|
|
121
|
+
{
|
|
122
|
+
if (needs_redraw_callback) return needs_redraw_callback();
|
|
123
|
+
return Window::needs_redraw();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
bool needs_cursor() const override
|
|
127
|
+
{
|
|
128
|
+
if (needs_cursor_callback) return needs_cursor_callback();
|
|
129
|
+
return Window::needs_cursor();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
void close() override
|
|
133
|
+
{
|
|
134
|
+
if (close_callback != nullptr) return close_callback();
|
|
135
|
+
Gosu::Window::close();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
void gain_focus() override
|
|
139
|
+
{
|
|
140
|
+
if (gain_focus_callback) gain_focus_callback();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
void lose_focus() override
|
|
144
|
+
{
|
|
145
|
+
if (lose_focus_callback) lose_focus_callback();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
std::function<void()> update_callback;
|
|
149
|
+
std::function<void()> draw_callback;
|
|
150
|
+
std::function<void(unsigned id)> button_down_callback;
|
|
151
|
+
std::function<void(unsigned id)> button_up_callback;
|
|
152
|
+
std::function<void(int index)> gamepad_connected_callback;
|
|
153
|
+
std::function<void(int index)> gamepad_disconnected_callback;
|
|
154
|
+
std::function<void(const char* filename)> drop_callback;
|
|
155
|
+
std::function<bool()> needs_redraw_callback;
|
|
156
|
+
std::function<bool()> needs_cursor_callback;
|
|
157
|
+
std::function<void()> close_callback;
|
|
158
|
+
std::function<void()> gain_focus_callback;
|
|
159
|
+
std::function<void()> lose_focus_callback;
|
|
160
|
+
};
|
data/ffi/Gosu_Font.cpp
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#include "Gosu_FFI_internal.h"
|
|
2
|
+
|
|
3
|
+
GOSU_FFI_API Gosu_Font* Gosu_Font_create(int height, const char* name, unsigned flags,
|
|
4
|
+
unsigned image_flags)
|
|
5
|
+
{
|
|
6
|
+
return Gosu_translate_exceptions([=] {
|
|
7
|
+
return new Gosu_Font(Gosu::Font(height, name, flags, image_flags));
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
GOSU_FFI_API void Gosu_Font_destroy(Gosu_Font* font)
|
|
12
|
+
{
|
|
13
|
+
delete font;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
GOSU_FFI_API const char* Gosu_Font_name(Gosu_Font* font)
|
|
17
|
+
{
|
|
18
|
+
thread_local std::string name;
|
|
19
|
+
|
|
20
|
+
return Gosu_translate_exceptions([=] {
|
|
21
|
+
name = font->font.name();
|
|
22
|
+
return name.c_str();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
GOSU_FFI_API int Gosu_Font_height(Gosu_Font* font)
|
|
27
|
+
{
|
|
28
|
+
return Gosu_translate_exceptions([=] {
|
|
29
|
+
return font->font.height();
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
GOSU_FFI_API double Gosu_Font_text_width(Gosu_Font* font, const char* text)
|
|
34
|
+
{
|
|
35
|
+
return Gosu_translate_exceptions([=] {
|
|
36
|
+
return font->font.text_width(text);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
GOSU_FFI_API double Gosu_Font_markup_width(Gosu_Font* font, const char* markup)
|
|
41
|
+
{
|
|
42
|
+
return Gosu_translate_exceptions([=] {
|
|
43
|
+
return font->font.markup_width(markup);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
GOSU_FFI_API bool Gosu_Font_draw_text(Gosu_Font* font, const char* text, double x, double y,
|
|
48
|
+
double z, double scale_x, double scale_y, unsigned c,
|
|
49
|
+
unsigned mode)
|
|
50
|
+
{
|
|
51
|
+
return Gosu_translate_exceptions([=] {
|
|
52
|
+
font->font.draw_text(text, x, y, z, scale_x, scale_y, c,
|
|
53
|
+
static_cast<Gosu::BlendMode>(mode));
|
|
54
|
+
return true;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
GOSU_FFI_API bool Gosu_Font_draw_markup(Gosu_Font* font, const char* markup, double x, double y,
|
|
59
|
+
double z, double scale_x, double scale_y, unsigned c,
|
|
60
|
+
unsigned mode)
|
|
61
|
+
{
|
|
62
|
+
return Gosu_translate_exceptions([=] {
|
|
63
|
+
font->font.draw_markup(markup, x, y, z, scale_x, scale_y, c,
|
|
64
|
+
static_cast<Gosu::BlendMode>(mode));
|
|
65
|
+
return true;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
GOSU_FFI_API bool Gosu_Font_draw_text_rel(Gosu_Font* font, const char* text, double x, double y,
|
|
70
|
+
double z, double rel_x, double rel_y, double scale_x,
|
|
71
|
+
double scale_y, unsigned c, unsigned mode)
|
|
72
|
+
{
|
|
73
|
+
return Gosu_translate_exceptions([=] {
|
|
74
|
+
font->font.draw_text_rel(text, x, y, z, rel_x, rel_y, scale_x, scale_y, c,
|
|
75
|
+
static_cast<Gosu::BlendMode>(mode));
|
|
76
|
+
return true;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
GOSU_FFI_API bool Gosu_Font_draw_markup_rel(Gosu_Font* font, const char* markup, double x, double y,
|
|
81
|
+
double z, double rel_x, double rel_y, double scale_x,
|
|
82
|
+
double scale_y, unsigned c, unsigned mode)
|
|
83
|
+
{
|
|
84
|
+
return Gosu_translate_exceptions([=] {
|
|
85
|
+
font->font.draw_markup_rel(markup, x, y, z, rel_x, rel_y, scale_x, scale_y, c,
|
|
86
|
+
static_cast<Gosu::BlendMode>(mode));
|
|
87
|
+
return true;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
GOSU_FFI_API void Gosu_Font_set_image(Gosu_Font* font, const char* codepoint, unsigned font_flags,
|
|
92
|
+
Gosu_Image* image)
|
|
93
|
+
{
|
|
94
|
+
Gosu_translate_exceptions([=] {
|
|
95
|
+
font->font.set_image(codepoint, font_flags, image->image);
|
|
96
|
+
});
|
|
97
|
+
}
|
data/ffi/Gosu_Font.h
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "Gosu_FFI.h"
|
|
4
|
+
#include "Gosu_Image.h"
|
|
5
|
+
|
|
6
|
+
typedef struct Gosu_Font Gosu_Font;
|
|
7
|
+
|
|
8
|
+
GOSU_FFI_API Gosu_Font* Gosu_Font_create(int height, const char* name, unsigned flags, unsigned image_flags);
|
|
9
|
+
GOSU_FFI_API void Gosu_Font_destroy(Gosu_Font* font);
|
|
10
|
+
|
|
11
|
+
GOSU_FFI_API const char* Gosu_Font_name(Gosu_Font* font);
|
|
12
|
+
GOSU_FFI_API int Gosu_Font_height(Gosu_Font* font);
|
|
13
|
+
|
|
14
|
+
GOSU_FFI_API double Gosu_Font_text_width(Gosu_Font* font, const char* text);
|
|
15
|
+
GOSU_FFI_API double Gosu_Font_markup_width(Gosu_Font* font, const char* markup);
|
|
16
|
+
|
|
17
|
+
GOSU_FFI_API bool Gosu_Font_draw_text(Gosu_Font* font, const char* text, double x, double y,
|
|
18
|
+
double z, double scale_x, double scale_y, unsigned c,
|
|
19
|
+
unsigned mode);
|
|
20
|
+
GOSU_FFI_API bool Gosu_Font_draw_markup(Gosu_Font* font, const char* markup, double x, double y,
|
|
21
|
+
double z, double scale_x, double scale_y, unsigned c,
|
|
22
|
+
unsigned mode);
|
|
23
|
+
|
|
24
|
+
GOSU_FFI_API bool Gosu_Font_draw_text_rel(Gosu_Font* font, const char* text, double x, double y,
|
|
25
|
+
double z, double rel_x, double rel_y, double scale_x,
|
|
26
|
+
double scale_y, unsigned c, unsigned mode);
|
|
27
|
+
GOSU_FFI_API bool Gosu_Font_draw_markup_rel(Gosu_Font* font, const char* markup, double x, double y,
|
|
28
|
+
double z, double rel_x, double rel_y, double scale_x,
|
|
29
|
+
double scale_y, unsigned c, unsigned mode);
|
|
30
|
+
|
|
31
|
+
GOSU_FFI_API void Gosu_Font_set_image(Gosu_Font* font, const char* codepoint, unsigned font_flags,
|
|
32
|
+
Gosu_Image* image);
|