make inputs up-to-date for game tick
This commit is contained in:
@ -212,14 +212,17 @@ static void main_loop(void) {
|
||||
poll_events();
|
||||
if (ctx.window_size_has_changed)
|
||||
update_viewport();
|
||||
input_state_update(&ctx.input);
|
||||
game_object_tick();
|
||||
input_state_update_postframe(&ctx.input);
|
||||
|
||||
#ifdef TWN_FEATURE_PUSH_AUDIO
|
||||
static uint8_t audio_buffer[(AUDIO_FREQUENCY / 60) * sizeof (float) * 2];
|
||||
audio_callback(NULL, audio_buffer, sizeof audio_buffer);
|
||||
if (SDL_QueueAudio(ctx.audio_device, audio_buffer, sizeof audio_buffer))
|
||||
CRY_SDL("Error queueing audio: ");
|
||||
#endif
|
||||
input_state_update(&ctx.input);
|
||||
|
||||
preserve_persistent_ctx_fields();
|
||||
|
||||
ctx.frame_accumulator -= ctx.desired_frametime;
|
||||
|
Reference in New Issue
Block a user