diff --git a/CMakeLists.txt b/CMakeLists.txt index baf9985..515f978 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,11 +138,18 @@ if(NOT MSVC) #-------------------------------------- add_compile_options("$<$:-g>") add_compile_options("$,-O0,-O2>") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wno-switch -Wno-unused-function -Wno-implicit-fallthrough") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") set(CMAKE_OBJC_FLAGS "${CMAKE_C_FLAGS}") set(CMAKE_OBJCXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-D_DEBUG) + add_definitions(-DDEBUG) +endif() + # Set compiler/platform specific flags and dependencies #-------------------------------------- if(WIN32) diff --git a/src/gl/MiniFB_GL.c b/src/gl/MiniFB_GL.c index b12dc64..737c010 100644 --- a/src/gl/MiniFB_GL.c +++ b/src/gl/MiniFB_GL.c @@ -145,13 +145,16 @@ destroy_GL_context(SWindowData *window_data) { } //------------------------------------- +#if defined(RGB) + #undef RGB +#endif + #define TEXTURE0 0x84C0 // [ Core in gl 1.3, gles1 1.0, gles2 2.0, glsc2 2.0, Provided by GL_ARB_multitexture (gl) ] #define RGB 0x1907 // [ Core in gl 1.0, gles1 1.0, gles2 2.0, glsc2 2.0 ] #define RGBA 0x1908 // [ Core in gl 1.0, gles1 1.0, gles2 2.0, glsc2 2.0 ] #define BGR 0x80E0 // [ Core in gl 1.2 ] #define BGRA 0x80E1 // [ Core in gl 1.2, Provided by GL_ARB_vertex_array_bgra (gl|glcore) ] - //------------------------------------- void init_GL(SWindowData *window_data) { diff --git a/src/gl/MiniFB_GL.h b/src/gl/MiniFB_GL.h index 77d11b6..7eb5cd7 100644 --- a/src/gl/MiniFB_GL.h +++ b/src/gl/MiniFB_GL.h @@ -2,8 +2,7 @@ #if defined(USE_OPENGL_API) - #include "WindowData.h" - #include + #include bool create_GL_context(SWindowData *window_data); void destroy_GL_context(SWindowData *window_data); diff --git a/src/windows/WinMiniFB.c b/src/windows/WinMiniFB.c index 1517c04..7eaf828 100644 --- a/src/windows/WinMiniFB.c +++ b/src/windows/WinMiniFB.c @@ -5,6 +5,9 @@ #if defined(USE_OPENGL_API) #include "gl/MiniFB_GL.h" #endif +#if defined(_DEBUG) || defined(DEBUG) + #include +#endif #include /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/windows/WindowData_Win.h b/src/windows/WindowData_Win.h index 8cca346..74fa04a 100644 --- a/src/windows/WindowData_Win.h +++ b/src/windows/WindowData_Win.h @@ -1,7 +1,6 @@ #pragma once #include -#include #define WIN32_LEAN_AND_MEAN #include