summaryrefslogtreecommitdiffstats
path: root/include/Utility.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-03 17:03:59 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-03 17:03:59 +0200
commitf7decf41d8d0062901cd39c42a3669a80537c7df (patch)
treed3032265df11eee6e3eaf8b4b081524bef5e72b2 /include/Utility.hpp
parent2017-07-29 (diff)
downloadAltCraft-f7decf41d8d0062901cd39c42a3669a80537c7df.tar
AltCraft-f7decf41d8d0062901cd39c42a3669a80537c7df.tar.gz
AltCraft-f7decf41d8d0062901cd39c42a3669a80537c7df.tar.bz2
AltCraft-f7decf41d8d0062901cd39c42a3669a80537c7df.tar.lz
AltCraft-f7decf41d8d0062901cd39c42a3669a80537c7df.tar.xz
AltCraft-f7decf41d8d0062901cd39c42a3669a80537c7df.tar.zst
AltCraft-f7decf41d8d0062901cd39c42a3669a80537c7df.zip
Diffstat (limited to '')
-rw-r--r--include/Utility.hpp55
1 files changed, 0 insertions, 55 deletions
diff --git a/include/Utility.hpp b/include/Utility.hpp
deleted file mode 100644
index 92e924f..0000000
--- a/include/Utility.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#pragma once
-
-#include <algorithm>
-
-#include <GL/glew.h>
-
-template<class T>
-void endswap(T *objp) {
- unsigned char *memp = reinterpret_cast<unsigned char *>(objp);
- std::reverse(memp, memp + sizeof(T));
-}
-
-template<class T>
-void endswap(T &obj) {
- unsigned char *raw = reinterpret_cast<unsigned char *>(&obj);
- std::reverse(raw, raw + sizeof(T));
-}
-
-inline void endswap(unsigned char *arr, size_t arrLen) {
- std::reverse(arr, arr + arrLen);
-}
-
-inline GLenum glCheckError_(const char *file, int line) {
- GLenum errorCode;
- while ((errorCode = glGetError()) != GL_NO_ERROR) {
- std::string error;
- switch (errorCode) {
- case GL_INVALID_ENUM:
- error = "INVALID_ENUM";
- break;
- case GL_INVALID_VALUE:
- error = "INVALID_VALUE";
- break;
- case GL_INVALID_OPERATION:
- error = "INVALID_OPERATION";
- break;
- case GL_STACK_OVERFLOW:
- error = "STACK_OVERFLOW";
- break;
- case GL_STACK_UNDERFLOW:
- error = "STACK_UNDERFLOW";
- break;
- case GL_OUT_OF_MEMORY:
- error = "OUT_OF_MEMORY";
- break;
- case GL_INVALID_FRAMEBUFFER_OPERATION:
- error = "INVALID_FRAMEBUFFER_OPERATION";
- break;
- }
- LOG(ERROR) << "OpenGL error: " << error << " at " << file << ":" << line;
- }
- return errorCode;
-}
-
-#define glCheckError() glCheckError_(__FILE__, __LINE__) \ No newline at end of file