@@ -63,7 +63,7 @@ liblol_core_headers = \ | |||||
lol/gpu/all.h \ | lol/gpu/all.h \ | ||||
lol/gpu/shader.h lol/gpu/indexbuffer.h lol/gpu/vertexbuffer.h \ | lol/gpu/shader.h lol/gpu/indexbuffer.h lol/gpu/vertexbuffer.h \ | ||||
lol/gpu/framebuffer.h lol/gpu/texture.h lol/gpu/lolfx.h \ | lol/gpu/framebuffer.h lol/gpu/texture.h lol/gpu/lolfx.h \ | ||||
lol/gpu/renderer.h lol/gpu/rendercontext.h \ | |||||
lol/gpu/renderer.h lol/gpu/rendercontext.h lol/gpu/debug.h \ | |||||
\ | \ | ||||
lol/debug/all.h \ | lol/debug/all.h \ | ||||
lol/debug/lines.h | lol/debug/lines.h | ||||
@@ -95,7 +95,7 @@ liblol_core_sources = \ | |||||
\ | \ | ||||
gpu/shader.cpp gpu/indexbuffer.cpp gpu/vertexbuffer.cpp \ | gpu/shader.cpp gpu/indexbuffer.cpp gpu/vertexbuffer.cpp \ | ||||
gpu/framebuffer.cpp gpu/texture.cpp gpu/renderer.cpp \ | gpu/framebuffer.cpp gpu/texture.cpp gpu/renderer.cpp \ | ||||
gpu/rendercontext.cpp \ | |||||
gpu/rendercontext.cpp gpu/debug.cpp \ | |||||
\ | \ | ||||
audio/audio.cpp audio/sample.cpp \ | audio/audio.cpp audio/sample.cpp \ | ||||
\ | \ | ||||
@@ -0,0 +1,26 @@ | |||||
// | |||||
// Lol Engine | |||||
// | |||||
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net> | |||||
// | |||||
// Lol Engine is free software. It comes without any warranty, to | |||||
// the extent permitted by applicable law. You can redistribute it | |||||
// and/or modify it under the terms of the Do What the Fuck You Want | |||||
// to Public License, Version 2, as published by the WTFPL Task Force. | |||||
// See http://www.wtfpl.net/ for more details. | |||||
// | |||||
#include <lol/engine-internal.h> | |||||
#include "lolgl.h" | |||||
namespace lol | |||||
{ | |||||
void gpu::error(char const *msg, int error) | |||||
{ | |||||
msg::error("%s: GL error 0x%04x\n", msg, error); | |||||
} | |||||
} | |||||
@@ -129,6 +129,7 @@ | |||||
<ClCompile Include="engine\worldentity.cpp" /> | <ClCompile Include="engine\worldentity.cpp" /> | ||||
<ClCompile Include="emitter.cpp" /> | <ClCompile Include="emitter.cpp" /> | ||||
<ClCompile Include="font.cpp" /> | <ClCompile Include="font.cpp" /> | ||||
<ClCompile Include="gpu\debug.cpp" /> | |||||
<ClCompile Include="gpu\framebuffer.cpp" /> | <ClCompile Include="gpu\framebuffer.cpp" /> | ||||
<ClCompile Include="gpu\indexbuffer.cpp" /> | <ClCompile Include="gpu\indexbuffer.cpp" /> | ||||
<ClCompile Include="gpu\lolfx.cpp" /> | <ClCompile Include="gpu\lolfx.cpp" /> | ||||
@@ -261,6 +262,7 @@ | |||||
<ClInclude Include="lol\engine-internal.h" /> | <ClInclude Include="lol\engine-internal.h" /> | ||||
<ClInclude Include="lol\extras.h" /> | <ClInclude Include="lol\extras.h" /> | ||||
<ClInclude Include="lol\gpu\all.h" /> | <ClInclude Include="lol\gpu\all.h" /> | ||||
<ClInclude Include="lol\gpu\debug.h" /> | |||||
<ClInclude Include="lol\gpu\framebuffer.h" /> | <ClInclude Include="lol\gpu\framebuffer.h" /> | ||||
<ClInclude Include="lol\gpu\indexbuffer.h" /> | <ClInclude Include="lol\gpu\indexbuffer.h" /> | ||||
<ClInclude Include="lol\gpu\lolfx.h" /> | <ClInclude Include="lol\gpu\lolfx.h" /> | ||||
@@ -79,6 +79,9 @@ | |||||
</ClCompile> | </ClCompile> | ||||
<ClCompile Include="emitter.cpp" /> | <ClCompile Include="emitter.cpp" /> | ||||
<ClCompile Include="font.cpp" /> | <ClCompile Include="font.cpp" /> | ||||
<ClCompile Include="gpu\debug.cpp"> | |||||
<Filter>gpu</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="gpu\framebuffer.cpp"> | <ClCompile Include="gpu\framebuffer.cpp"> | ||||
<Filter>gpu</Filter> | <Filter>gpu</Filter> | ||||
</ClCompile> | </ClCompile> | ||||
@@ -387,6 +390,9 @@ | |||||
<ClInclude Include="lol\gpu\all.h"> | <ClInclude Include="lol\gpu\all.h"> | ||||
<Filter>lol\gpu</Filter> | <Filter>lol\gpu</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="lol\gpu\debug.h"> | |||||
<Filter>lol\gpu</Filter> | |||||
</ClInclude> | |||||
<ClInclude Include="lol\gpu\framebuffer.h"> | <ClInclude Include="lol\gpu\framebuffer.h"> | ||||
<Filter>lol\gpu</Filter> | <Filter>lol\gpu</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
@@ -10,6 +10,7 @@ | |||||
#pragma once | #pragma once | ||||
#include <lol/gpu/debug.h> | |||||
#include <lol/gpu/shader.h> | #include <lol/gpu/shader.h> | ||||
#include <lol/gpu/indexbuffer.h> | #include <lol/gpu/indexbuffer.h> | ||||
#include <lol/gpu/vertexbuffer.h> | #include <lol/gpu/vertexbuffer.h> | ||||
@@ -0,0 +1,26 @@ | |||||
// | |||||
// Lol Engine | |||||
// | |||||
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net> | |||||
// | |||||
// Lol Engine is free software. It comes without any warranty, to | |||||
// the extent permitted by applicable law. You can redistribute it | |||||
// and/or modify it under the terms of the Do What the Fuck You Want | |||||
// to Public License, Version 2, as published by the WTFPL Task Force. | |||||
// See http://www.wtfpl.net/ for more details. | |||||
// | |||||
#pragma once | |||||
namespace lol | |||||
{ | |||||
namespace gpu | |||||
{ | |||||
void error(char const *msg, int error); | |||||
} // namespace gpu | |||||
} // namespace lol | |||||
@@ -61,9 +61,13 @@ | |||||
# endif | # endif | ||||
#endif | #endif | ||||
#define LOL_STRINGIFY_INNER(n) #n | |||||
#define LOL_STRINGIFY(n) LOL_STRINGIFY_INNER(n) | |||||
#define LOL_CHECK_GLERROR() \ | #define LOL_CHECK_GLERROR() \ | ||||
{ \ | { \ | ||||
GLenum error = glGetError(); \ | GLenum error = glGetError(); \ | ||||
ASSERT(error == GL_NO_ERROR, "OpenGL error: 0x%04x\n", error); \ | |||||
if (error != GL_NO_ERROR) \ | |||||
lol::gpu::error(__FILE__ ":" LOL_STRINGIFY(__LINE__), (int)error); \ | |||||
} | } | ||||