2018-02-26 15:24:21 -08:00
|
|
|
#ifndef KRHELPERS_H
|
|
|
|
|
#define KRHELPERS_H
|
|
|
|
|
|
2018-03-05 15:24:27 -08:00
|
|
|
#if defined(KRAKEN_USE_OPENGL)
|
|
|
|
|
|
2018-02-26 15:24:21 -08:00
|
|
|
#if defined(_WIN32) || defined(_WIN64)
|
|
|
|
|
#include <GL/glew.h>
|
|
|
|
|
#elif defined(__linux__) || defined(__unix__) || defined(__posix__)
|
|
|
|
|
#include <GL/gl.h>
|
|
|
|
|
#include <GL/glu.h>
|
|
|
|
|
#include <GL/glext.h>
|
|
|
|
|
#elif defined(__APPLE__)
|
|
|
|
|
#include <OpenGL/gl3.h>
|
|
|
|
|
#include <OpenGL/gl3ext.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-03-05 15:24:27 -08:00
|
|
|
#endif // defined(KRAKEN_USE_OPENGL)
|
|
|
|
|
|
2018-04-22 23:11:50 -07:00
|
|
|
#include "../include/hydra.h"
|
2018-02-26 15:24:21 -08:00
|
|
|
|
|
|
|
|
#define KRMIN(x,y) ((x) < (y) ? (x) : (y))
|
|
|
|
|
#define KRMAX(x,y) ((x) > (y) ? (x) : (y))
|
|
|
|
|
#define KRCLAMP(x, min, max) (KRMAX(KRMIN(x, max), min))
|
|
|
|
|
#define KRALIGN(x) ((x + 3) & ~0x03)
|
|
|
|
|
|
|
|
|
|
float const PI = 3.141592653589793f;
|
|
|
|
|
float const D2R = PI * 2 / 360;
|
|
|
|
|
|
2018-03-05 15:24:27 -08:00
|
|
|
#if defined(KRAKEN_USE_OPENGL)
|
2018-02-26 15:24:21 -08:00
|
|
|
namespace kraken {
|
|
|
|
|
void SetUniform(GLint location, const Vector2 &v);
|
|
|
|
|
void SetUniform(GLint location, const Vector3 &v);
|
|
|
|
|
void SetUniform(GLint location, const Vector4 &v);
|
|
|
|
|
void SetUniform(GLint location, const Matrix4 &v);
|
|
|
|
|
} // namespace kraken
|
2018-03-05 15:24:27 -08:00
|
|
|
#endif // defined(KRAKEN_USE_OPENGL)
|
2018-02-26 15:24:21 -08:00
|
|
|
|
|
|
|
|
#endif
|