Refactored.

This commit is contained in:
2021-04-22 13:55:34 +10:00
parent 5897c1045d
commit ea3e502524
62 changed files with 1033 additions and 1391 deletions

View File

@ -1,58 +1,31 @@
/**
* Copyright (c) 2021 Dominic Msters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
// Copyright (c) 2021 Dominic Masters
//
// 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;
#include <dawn/dawn.h>
/**
* Initialize the renderer.
*
* @param name String of the windows' name.
* @return Rendering Context information.
*/
render_t * renderInit(char *name);
void renderInit();
/**
* 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);
void renderFrameStart();
/**
* Cleanup a render context.
*
* @param render Renderer to cleanup.
* @return True or False if Successful/Not.
*/
bool renderDispose(render_t *render);
void renderDispose();
/**
* Set the internal display resolution.
* Sets 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.
* @param width Width of the display (in pixels).
* @param height Height of the display (in pixels).
*/
void renderSetResolution(render_t *render, uint32_t width, uint32_t height);
void renderSetResolution(int32_t width, int32_t height);