/** * 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. renderResetFramebuffer(render); } void renderDispose() { } void renderSetResolution(render_t *render, float width, float height) { ASSERT_NOT_NULL(render); ASSERT_GREATER_THAN(width, 0); ASSERT_GREATER_THAN(height, 0); render->width = width; render->height = height; } void renderResetFramebuffer(render_t *render) { ASSERT_NOT_NULL(render); frameBufferUnbind(render->width, render->height, true); }