diff --git a/src/app.cpp b/src/app.cpp index 408075c..8f813a0 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -387,32 +387,35 @@ void App::upload(std::string filename, std::string name, std::function colors = { - { GL_DEBUG_SEVERITY_NOTIFICATION, 8 }, - { GL_DEBUG_SEVERITY_LOW, 8 }, - { GL_DEBUG_SEVERITY_MEDIUM, FOREGROUND_GREEN | FOREGROUND_INTENSITY }, - { GL_DEBUG_SEVERITY_HIGH, FOREGROUND_RED | FOREGROUND_INTENSITY }, - }; - if (severity == GL_DEBUG_SEVERITY_HIGH || severity == GL_DEBUG_SEVERITY_MEDIUM || severity == GL_DEBUG_SEVERITY_LOW) + static CONSOLE_SCREEN_BUFFER_INFO info; + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info); + // colors: http://stackoverflow.com/questions/4053837/colorizing-text-in-the-console-with-c + glDebugMessageCallback([](GLenum source, GLenum type, GLuint id, + GLenum severity, GLsizei length, const GLchar* message, const void* userParam) { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), colors[severity]); - LOG("OPENGL: %.*s", length, message); - FlushConsoleInputBuffer(GetStdHandle(STD_OUTPUT_HANDLE)); - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), info.wAttributes); -#ifdef _WIN32 && _DEBUG - if (severity == GL_DEBUG_SEVERITY_HIGH) - __debugbreak(); -#endif - } - }, nullptr); - glEnable(GL_DEBUG_OUTPUT); - glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); + static std::map colors = { + { GL_DEBUG_SEVERITY_NOTIFICATION, 8 }, + { GL_DEBUG_SEVERITY_LOW, 8 }, + { GL_DEBUG_SEVERITY_MEDIUM, FOREGROUND_GREEN | FOREGROUND_INTENSITY }, + { GL_DEBUG_SEVERITY_HIGH, FOREGROUND_RED | FOREGROUND_INTENSITY }, + }; + if (severity == GL_DEBUG_SEVERITY_HIGH || severity == GL_DEBUG_SEVERITY_MEDIUM || severity == GL_DEBUG_SEVERITY_LOW) + { + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), colors[severity]); + LOG("OPENGL: %.*s", length, message); + FlushConsoleInputBuffer(GetStdHandle(STD_OUTPUT_HANDLE)); + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), info.wAttributes); + #ifdef _WIN32 && _DEBUG + if (severity == GL_DEBUG_SEVERITY_HIGH) + __debugbreak(); + #endif + } + }, nullptr); + glEnable(GL_DEBUG_OUTPUT); + glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); + } #endif LOG("GL version: %s", glGetString(GL_VERSION)); diff --git a/src/main.cpp b/src/main.cpp index a0f78e0..e674315 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -887,6 +887,7 @@ int main(int argc, char** argv) } else { + LOG("WGL_ARB_create_context not supported"); // If not supported, go fuck yourself we are not gonna support your shitty device return -1; // A negative number because you are a negative one } diff --git a/steam/build.bat b/steam/build.bat index 3645884..ea630bc 100644 --- a/steam/build.bat +++ b/steam/build.bat @@ -2,6 +2,7 @@ mkdir content xcopy /I /D /Y /S "..\x64\Release\*.dll" content xcopy /I /D /Y /S "..\x64\Release\*.pdb" content +xcopy /I /D /Y /S "..\x64\Release\*.exe" content robocopy ..\data\ content\data\ /MIR for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set BRANCH=%%i for /f %%i in ('git log "--pretty=format:%%h" -n 1') do set HASH=%%i @@ -10,6 +11,6 @@ for /f %%i in ('git describe --tags "--abbrev=0"') do set TAG=%%i set VERSION=%TAG%.%COUNT% (%HASH%-%BRANCH%) echo Building version %VERSION% set /p ID=