Dawn/src/display/render.c
2021-09-19 12:40:39 -07:00

37 lines
763 B
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "render.h"
void renderInit() {
// Enable GL things.
glEnable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
// Setup the alpha blend function.
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL);
glClearColor(0,0,0, 0.0);
}
void renderFrameStart(render_t *render) {
// Clear the frame buffer.
frameBufferUnbind(render->width, render->height, true);
}
void renderDispose() {
}
void renderSetResolution(render_t *render, float width, float height) {
render->width = width;
render->height = height;
}