sdl3 2.8.5
sdl3: ^2.8.5 copied to clipboard
A Dart library for accessing common SDL3 (and SDL3_image, SDL3_mixer, SDL3_net, SDL3_ttf, SDL3_gfx, SDL3_shadercross) APIs using, FFI.
SDL3 for Dart #
Requirement #
- ffi ^2.2.0
This library is limited to 64bit.
Since ffi is used, a dynamic library suitable for various environments is required.
image, mixer, net, and ttf are optional. Please include it if necessary.
Since sdl3gfx is included in the source, a dynamic library is not required.
For OpenGL, call require separately.
import 'package:sdl3/sdl3.dart'; // SDL3, SDL3_image, SDL3_mixer, SDL3_net, SDL3_ttf, SDL3_shadercross
import 'package:sdl3/sdl3gfx.dart'; // SDL3_gfx
import 'package:sdl3/sdl3opengl.dart'; // OpenGL
Windows requires dll files. #
SDL3.dll
SDL3_image.dll
SDL3_mixer.dll
SDL3_net.dll
SDL3_ttf.dll
SDL3_shadercross.dll
Linux requires so files. #
libSDL3.so.0
libSDL3_image.so.0
libSDL3_mixer.so.0
libSDL3_net.so.0
libSDL3_ttf.so.0
libSDL3_shadercross.so.0
Android, Fuchsia requires so files. #
libSDL3.so
libSDL3_image.so
libSDL3_mixer.so
libSDL3_net.so
libSDL3_ttf.so
libSDL3_shadercross.so
MacOS (or iOS) requires dylib files. #
libSDL3.dylib
libSDL3_image.dylib
libSDL3_mixer.dylib
libSDL3_net.dylib
libSDL3_ttf.dylib
libSDL3_shadercross.dylib
And more. #
If you want to set a library under special circumstances (example: dylib), do the following:
SdlDynamicLibraryService().set('sdl', 'YOUR_SDL3_ENVIONMENT.dylib');
SdlDynamicLibraryService().set('image', 'YOUR_SDL3_image_ENVIONMENT.dylib');
SdlDynamicLibraryService().set('mixer', 'YOUR_SDL3_mixer_ENVIONMENT.dylib');
SdlDynamicLibraryService().set('net', 'YOUR_SDL3_net_ENVIONMENT.dylib');
SdlDynamicLibraryService().set('ttf', 'YOUR_SDL3_ttf_ENVIONMENT.dylib');
SdlDynamicLibraryService().set('shadercross', 'YOUR_SDL3_shadercross_ENVIONMENT.dylib');
if (sdlInit(SDL_INIT_VIDEO)) {
// success
}
Note #
A Dart library for accessing SDL 3 APIs using, FFI.
Windows 64bit & Linux (Tested under Windows 11 WSL2 environment)
Currently, we are providing it on an experimental basis using the dll compiled below.
https://github.com/sansuido/build-sdl3
Examples #
learnopengl.com for Dart #
https://github.com/sansuido/sdl3_learnopengl/
SDL_gpu_examples for Dart #
https://github.com/sansuido/sdl3_gpu_examples/
SDL_projects for Dart #
https://github.com/sansuido/sdl3_projects/
Author #
yamahara
Task List (for 2.9.0) #
- ✅
lib_sdl.dart - ✅
lib_sdl_assert.dart - ✅ lib_sdl_asyncio.dart
- ❌ lib_sdl_atomic.dart
- ✅ lib_sdl_audio.dart
- ✅
lib_sdl_blendmode.dart - ❌ lib_sdl_camera.dart
- ✅ lib_sdl_clipboard.dart
- ✅
lib_sdl_cpuinfo.dart - ✅ lib_sdl_dialog.dart
- ✅
lib_sdl_error.dart - ✅ lib_sdl_events.dart
- ❌ lib_sdl_filesystem.dart
- ❌ lib_sdl_gamepad.dart
- ✅ lib_sdl_gpu.dart
- ❌ lib_sdl_guid.dart
- ❌ lib_sdl_haptic.dart
- ❌ lib_sdl_hidapi.dart
- ❌
lib_sdl_hints.dart - ✅ lib_sdl_image.dart
- ❌
lib_sdl_init.dart - ❌ lib_sdl_iostream.dart
- ❌ lib_sdl_joystick.dart
- ✅ lib_sdl_keyboard.dart
- ❌ lib_sdl_loadso.dart
- ❌ lib_sdl_locale.dart
- ❌
lib_sdl_log.dart - ❌ lib_sdl_main.dart
- ✅ lib_sdl_messagebox.dart
- ❌
lib_sdl_metal.dart - ✅
lib_sdl_misc.dart - ✅ lib_sdl_mixer.dart
- ✅ lib_sdl_mouse.dart
- ❌ lib_sdl_mutex.dart
- ❌ lib_sdl_net.dart
- ❌ lib_sdl_opengl.dart
- ❌ lib_sdl_opengl_glext.dart
- ❌ lib_sdl_openxr.dart
- ✅
lib_sdl_pen.dart - ✅ lib_sdl_pixels.dart
- ✅
lib_sdl_platform.dart - ❌ lib_sdl_power.dart
- ❌ lib_sdl_process.dart
- ❌ lib_sdl_properties.dart
- ✅ lib_sdl_rect.dart
- ✅ lib_sdl_render.dart
- ❌ lib_sdl_sensor.dart
- ✅ lib_sdl_shadercross.dart
- ❌ lib_sdl_stdinc.dart
- ❌ lib_sdl_storage.dart
- ✅ lib_sdl_surface.dart
- ❌ lib_sdl_system.dart
- ❌ lib_sdl_thread.dart
- ❌ lib_sdl_time.dart
- ✅
lib_sdl_timer.dart - ❌ lib_sdl_touch.dart
- ❌ lib_sdl_tray.dart
- ✅ lib_sdl_ttf.dart
- ✅
lib_sdl_version.dart - ✅ lib_sdl_video.dart
- ❌ lib_sdl_vulkan.dart