2021-01-19 19:25:46 +01:00
|
|
|
#include "openglu.hpp"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
namespace oglu
|
|
|
|
{
|
|
|
|
void LoadGLLoader(GLADloadproc proc)
|
|
|
|
{
|
|
|
|
if (!gladLoadGLLoader(proc))
|
|
|
|
{
|
2021-01-21 15:48:31 +01:00
|
|
|
throw std::runtime_error("Failed to initialize GLAD");
|
2021-01-19 19:25:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetViewport(GLint x, GLint y, GLsizei width, GLsizei height)
|
|
|
|
{
|
|
|
|
glViewport(x, y, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ClearScreen(GLbitfield mask, Color clearColor)
|
|
|
|
{
|
|
|
|
glClearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a);
|
|
|
|
glClear(mask);
|
|
|
|
}
|
|
|
|
}
|