WIP organization of library

This commit is contained in:
Kearwood Kip Gilbert
2017-07-29 00:26:35 -07:00
parent 4d4b176ddf
commit 3ca57d56ee
14 changed files with 162 additions and 92 deletions

29
kraken/KRHelpers.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef KRHELPERS_H
#define KRHELPERS_H
#if defined(_WIN32) || defined(_WIN64)
#include <GL/glew.h>
#include "../3rdparty/tinyxml2/tinyxml2.h"
#endif
#include "KREngine-common.h"
#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;
namespace kraken {
void SetUniform(GLint location, const KRVector2 &v);
void SetUniform(GLint location, const KRVector3 &v);
void SetUniform(GLint location, const KRVector4 &v);
void SetUniform(GLint location, const KRMat4 &v);
void setXMLAttribute(const std::string &base_name, ::tinyxml2::XMLElement *e, const KRVector3 &value, const KRVector3 &default_value);
const KRVector3 getXMLAttribute(const std::string &base_name, ::tinyxml2::XMLElement *e, const KRVector3 &default_value);
} // namespace kraken
#endif