Age | Commit message (Collapse) | Author |
|
Sometimes a more granular main loop integration is required.
In such situations play_run() taking over is untenable, so this
splits out the body of play_run()'s loop as a separately callable
function. Existing main loops can use this to run the play main
loop for a single slice.
The impetus for this has been experimenting with escripten
support in SARS, e.g.
emscripten_set_main_loop_arg((void(*)(void *))play_run_slice, play, -1, 1);
|
|
Abstract the sdl relative mouse things behind an ownership
concept.
In the future libplay will probably get more involved in
projection transformation and pointer event coordinates mapping
to the projection when owned. Though for now libplay doesn't get
involved in such things.
|
|
Callers manually resetting timers often need to assign
the reset ticks count somewhere, this makes it so they can
just assign it directly from the reset call.
Otherwise this can be ignored...
|
|
This adds the ability to turn off the audio/music parts of the
API, removing the SDL2_Mixer dependency when disabled.
It will also automatically disable the audio/music parts of the
API when SDL2_Mixer isn't detected @ configure time and
--with-audio was unspecified.
It's a bit ugly with a bunch of #ifdef's in play.c, oh well.
|
|
Prep for conditional audio/music support, having automake-generated
Makefiles which rebuild on configuration changes naturally occurs
when the compilation units include config.h.
It's unclear to me how to do this simply when the configuration only
affects the generated Makefiles, since automake doens't seem to add
a dependency on the Makefile for some reason.
|
|
Introduce flags for disabling audio/video/gamecontroller caps
Most of the time, all of these will be desirable for a game. But
sometimes I might use this as a quick bootstrap into SDL land,
especially as I accumulate play_ops_t boilerplate I'd like to
be maximally reusable. The video-only use case is particularly
likely especially for development tools, and I'm likely to have
a corpus of play_ops_t integrations for the myriad GL/vulkan
flavors...
Note the flags are plumbed down to the play_ops_t.init hook so
ops implementations can also be flags-aware.
I didn't try make things like audio samplerate/channels
configurable, as this library is intended to be a vendored .a
anyways there's no hard ABI/API commitments. It can always
grow and evolve when the need arises.
|
|
This is largely ripped out of Eon to try give a reusable
scaffolding for accelerating SDL-based simple game development.
I expect there to be future commits adding more configurability
like a means of influencing which flags are passed to SDL_Init(),
e.g. if you have no need for joystick support, don't pass in that
flag, and libplay won't pass it to SDL_Init() and do the joystick
opening/mapping dance, etc.
|