/**
 * 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);

  // Setup the alpha blend function.
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  glDepthMask(GL_TRUE);
  glDepthFunc(GL_LEQUAL);
}

void renderFrameStart(render_t *render) {
  // Clear the frame buffer.
  frameBufferUnbind(render, true);
}

void renderDispose() {
}

void renderSetResolution(render_t *render, int32_t width, int32_t height) {
  render->width = width;
  render->height = height;
}