Reshuffled

This commit is contained in:
2021-04-19 21:30:34 +10:00
parent eca6c56d00
commit 365a57ff5a
45 changed files with 218 additions and 140 deletions

58
src/display/render.h Normal file
View File

@ -0,0 +1,58 @@
/**
* Copyright (c) 2021 Dominic Msters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <malloc.h>
#include <glad/glad.h>
#include <cglm/call.h>
#include "primitive.h"
/**
* Contains information about the current render state, can be used for querying
* how the renderer is currently set up.
*/
typedef struct {
/** Resolution (in pixels) */
int32_t width, height;
} render_t;
/**
* Initialize the renderer.
*
* @param name String of the windows' name.
* @return Rendering Context information.
*/
render_t * renderInit(char *name);
/**
* Render a single frame of the render loop. The renderer is not (currently)
* responsible for render looping.
*
* @param render The renderer to loop for.
*/
void renderFrame(render_t *render);
/**
* Cleanup a render context.
*
* @param render Renderer to cleanup.
* @return True or False if Successful/Not.
*/
bool renderDispose(render_t *render);
/**
* Set the internal display resolution.
*
* @param render Renderer to set resolution for.
* @param width Width (in pixels) of the viewport.
* @param height Height (in pixels) of the viewport.
*/
void renderSetResolution(render_t *render, uint32_t width, uint32_t height);