60 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| // Copyright (c) 2021 Dominic Msters
 | |
| // 
 | |
| // This software is released under the MIT License.
 | |
| // https://opensource.org/licenses/MIT
 | |
| 
 | |
| #pragma once
 | |
| #include <stdbool.h>
 | |
| #include "display/render.h"
 | |
| #include "input/input.h"
 | |
| #include "./platform.h"
 | |
| 
 | |
| #include "file/asset.h"
 | |
| #include "display/shader.h"
 | |
| #include "display/camera.h"
 | |
| #include "world/world.h"
 | |
| #include "world/chunklist.h"
 | |
| 
 | |
| 
 | |
| /** Information about the current engine context. */
 | |
| typedef struct {
 | |
|   /** Name of the game running. */
 | |
|   char *name;
 | |
| 
 | |
|   /** Platform the game is running on */
 | |
|   platform_t *platform;
 | |
| 
 | |
|   /** Renderer for the engine. */
 | |
|   render_t *render;
 | |
|   
 | |
|   /** Input Manager for the engine. */
 | |
|   input_t *input;
 | |
| } engine_t;
 | |
| 
 | |
| /**
 | |
|  * Initialize the engine context.
 | |
|  * 
 | |
|  * @param platform The platform that the game is running on.
 | |
|  * @param name Name of the game being initialized.
 | |
|  * @param inputCount Count of input binds that exist in-engine.
 | |
|  * @return The engine context.
 | |
|  */
 | |
| engine_t * engineInit(platform_t *platform, char *name, uint32_t inputCount);
 | |
| 
 | |
| /**
 | |
|  * Start the main engine loop.
 | |
|  * 
 | |
|  * @param engine The game to start the loop for.
 | |
|  * @return 0 if success (and loop to continue), 1 for non error terminate.
 | |
|  */
 | |
| uint32_t engineUpdate(engine_t *engine);
 | |
| 
 | |
| /**
 | |
|  * Cleanup a previously constructed game engine instance.
 | |
|  * 
 | |
|  * @param engine The engine to cleanup.
 | |
|  * @return True if successful or not.
 | |
|  */
 | |
| bool engineDispose(engine_t *engine);
 | |
| 
 |