From 6a00886804c53883d919f008f6ec47a574d86607 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Mon, 24 Jul 2017 19:52:24 +0500 Subject: 2017-07-24 --- include/Utility.hpp | 59 ----------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 include/Utility.hpp (limited to 'include/Utility.hpp') diff --git a/include/Utility.hpp b/include/Utility.hpp deleted file mode 100644 index 11b4ff7..0000000 --- a/include/Utility.hpp +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include - -#include - -template -void endswap(T *objp) { - unsigned char *memp = reinterpret_cast(objp); - std::reverse(memp, memp + sizeof(T)); -} - -template -void endswap(T &obj) { - unsigned char *raw = reinterpret_cast(&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; - } - static int t = 0; - t++; - if (t>10) - LOG(FATAL); - LOG(ERROR) << "OpenGL error: " << error << " at " << file << ":" << line; - } - return errorCode; -} - -#define glCheckError() glCheckError_(__FILE__, __LINE__) \ No newline at end of file -- cgit v1.2.3