check glDebugMessageCallback
This commit is contained in:
51
src/app.cpp
51
src/app.cpp
@@ -387,32 +387,35 @@ void App::upload(std::string filename, std::string name, std::function<void(floa
|
||||
void App::init()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
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)
|
||||
if (glDebugMessageCallback)
|
||||
{
|
||||
static std::map<GLenum, int> 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<GLenum, int> 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));
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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=<steamid.txt
|
||||
steamcmd.exe +login %ID% +drm_wrap 954880 "%~dp0..\x64\Release\PanoPainter.exe" "%~dp0content\PanoPainter.exe" drmtoolp 0 +run_app_build -desc "%VERSION%" "%~dp0scripts\app_build_954880.vdf" +quit
|
||||
steamcmd.exe +login %ID% +run_app_build -desc "%VERSION%" "%~dp0scripts\app_build_954880.vdf" +quit
|
||||
7z.exe a "PanoPainter-Steam-%VERSION%.zip" content\*
|
||||
pause
|
||||
Reference in New Issue
Block a user