Added color

This commit is contained in:
Robert 2021-01-19 19:25:46 +01:00
commit c40a38253d
13 changed files with 8300 additions and 0 deletions

39
include/color.hpp Normal file
View file

@ -0,0 +1,39 @@
#ifndef COLOR_HPP
#define COLOR_HPP
#include "core.hpp"
#include <glad/glad.h>
namespace oglu
{
class OGLU_API Color
{
public:
Color();
Color(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha = 255);
public:
GLfloat r, g, b, a;
static const Color Black;
static const Color White;
static const Color Red;
static const Color Green;
static const Color Blue;
static const Color Yellow;
static const Color Magenta;
static const Color Cyan;
static const Color Transparent;
};
OGLU_API bool operator==(const Color& left, const Color& right);
OGLU_API bool operator!=(const Color& left, const Color& right);
OGLU_API Color operator+(const Color& left, const Color& right);
OGLU_API Color operator-(const Color& left, const Color& right);
OGLU_API Color operator*(const Color& left, const Color& right);
OGLU_API Color& operator+=(Color& left, const Color& right);
OGLU_API Color& operator-=(Color& left, const Color& right);
OGLU_API Color& operator*=(Color& left, const Color& right);
}
#endif

14
include/core.hpp Normal file
View file

@ -0,0 +1,14 @@
#ifndef CORE_HPP
#define CORE_HPP
#ifdef OGLU_WIN32
#ifdef OGLU_BUILD_DLL
#define OGLU_API __declspec(dllexport)
#else
#define OGLU_API __declspec(dllimport)
#endif //OGLU_BUILD_DLL
#else
#define OGLU_API
#endif //OGLU_WIN32
#endif

18
include/openglu.hpp Normal file
View file

@ -0,0 +1,18 @@
#ifndef OPENGLU_HPP
#define OPENGLU_HPP
#include "core.hpp"
#include <glad/glad.h>
#include "color.hpp"
namespace oglu
{
OGLU_API void LoadGLLoader(GLADloadproc proc);
// Some raw, exposed OpenGL until I know where to put then
OGLU_API void SetViewport(GLint x, GLint y, GLsizei width, GLsizei height);
OGLU_API void ClearScreen(GLbitfield mask, Color clearColor);
}
#endif //OPENGLU_HPP