HandmadeHero/project/platform/platform_engine_api.hpp

22 lines
755 B
C++
Raw Normal View History

2023-09-23 18:03:33 -07:00
/*
This represents the API only accessible to the platform layer to fullfill for the engine layer.
*/
#pragma once
#include "engine.hpp"
2023-09-23 18:03:33 -07:00
NS_ENGINE_BEGIN
void startup();
void shutdown();
// Needs a contextual reference to four things:
2023-09-24 19:37:05 -07:00
// Timing, Input, Bitmap Buffer
void update_and_render( InputState* input, OffscreenBuffer* back_buffer, Memory* memory );
// Audio timing is complicated, processing samples must be done at a different period from the rest of the engine's usual update.
// IMPORTANT: This has very tight timing, and cannot be more than a millisecond in execution.
// TODO(Ed) : Reduce timing pressure on performance by measuring it or pinging its time.
void update_audio( AudioBuffer* audio_buffer, Memory* memory );
2023-09-23 18:03:33 -07:00
NS_ENGINE_END