Much much better

This commit is contained in:
2021-02-23 07:57:24 +11:00
parent 11ca3d96e3
commit f4c2491592
24 changed files with 371 additions and 360 deletions

View File

@ -1,70 +0,0 @@
/**
* 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>
// I load GLAD and GLFW Here because they need to be included in specific orders
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <cglm/call.h>
#define WINDOW_WIDTH_DEFAULT 480
#define WINDOW_HEIGHT_DEFAULT 270
/**
* Contains information about the current render state, can be used for querying
* how the renderer is currently set up.
*/
typedef struct {
/** The GLFW Window Context Pointer */
GLFWwindow *window;
/** Resolution (in pixels) */
int32_t width, height;
} render_t;
/** Current active renderer. */
extern render_t *RENDER_CURRENT;
/**
* 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);
/**
* Resize callbacks.
*
* @param window Window that was resized.
* @param width New window width.
* @param height New window height.
*/
void renderOnResize(GLFWwindow *window, int32_t width, int32_t height);