Skip to content

Commit

Permalink
Fixed compilation errors in Release mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
pboechat committed Jun 3, 2024
1 parent fe5a7d0 commit 3880ea3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
50 changes: 23 additions & 27 deletions FastCG/src/Graphics/OpenGL/OpenGLGraphicsSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,19 @@ namespace
FASTCG_THROW_EXCEPTION(FastCG::Exception, "WGL: WGL_ARB_create_context extension not supported");
}

const int contextAttribs[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB,
4,
WGL_CONTEXT_MINOR_VERSION_ARB,
3,
WGL_CONTEXT_PROFILE_MASK_ARB,
WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
WGL_CONTEXT_FLAGS_ARB,
WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
const int contextAttribs[] = {WGL_CONTEXT_MAJOR_VERSION_ARB,
4,
WGL_CONTEXT_MINOR_VERSION_ARB,
3,
WGL_CONTEXT_PROFILE_MASK_ARB,
WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
WGL_CONTEXT_FLAGS_ARB,
WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
#if _DEBUG
| WGL_CONTEXT_DEBUG_BIT_ARB
| WGL_CONTEXT_DEBUG_BIT_ARB
#endif
,
0
};
,
0};

auto context = wglCreateContextAttribsARB(deviceContext, parentContext, contextAttribs);
if (context == nullptr)
Expand Down Expand Up @@ -701,7 +699,7 @@ namespace FastCG
auto *pFbConfigs = glXChooseFBConfig(pDisplay, defaultScreen, fbAttribs, &numFbConfigs);

GLXFBConfig fbConfig = nullptr;
XVisualInfo *pVisualInfo;
XVisualInfo *pVisualInfo = nullptr;
for (int i = 0; i < numFbConfigs; i++)
{
auto *pCurrVisualInfo = (XVisualInfo *)glXGetVisualFromFBConfig(pDisplay, pFbConfigs[i]);
Expand Down Expand Up @@ -742,21 +740,19 @@ namespace FastCG

auto oldContext = mContext;

const int contextAttribs[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB,
4,
GLX_CONTEXT_MINOR_VERSION_ARB,
3,
GLX_CONTEXT_PROFILE_MASK_ARB,
GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
GLX_CONTEXT_FLAGS_ARB,
GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
const int contextAttribs[] = {GLX_CONTEXT_MAJOR_VERSION_ARB,
4,
GLX_CONTEXT_MINOR_VERSION_ARB,
3,
GLX_CONTEXT_PROFILE_MASK_ARB,
GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
GLX_CONTEXT_FLAGS_ARB,
GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
#if _DEBUG
| GLX_CONTEXT_DEBUG_BIT_ARB
| GLX_CONTEXT_DEBUG_BIT_ARB
#endif
,
0
};
,
0};

auto *pOldErrorHandler = XSetErrorHandler(&GLXContextErrorHandler);
mContext = glXCreateContextAttribsARB(pDisplay, fbConfig, oldContext, True, contextAttribs);
Expand Down
7 changes: 7 additions & 0 deletions dependencies/basisu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ target_compile_definitions(
BASISU_SUPPORT_SSE=0 # TODO:
BASISU_SUPPORT_OPENCL=0
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(
${PROJECT_NAME}
PUBLIC
-Wno-stringop-overflow
)
endif()
target_link_libraries(${PROJECT_NAME} zlib)

0 comments on commit 3880ea3

Please sign in to comment.