Skip to content

Commit

Permalink
Fix building on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed Abdel Aal committed Sep 30, 2020
1 parent 5a63c4b commit 70460ad
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 28 deletions.
41 changes: 30 additions & 11 deletions opengl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,36 @@ if(UNIX)
target_link_libraries(programmablePipelineX11 PRIVATE X11::X11 OpenGL::GL options::options)
endif()

add_executable(fixedPipelineOpenGLSDL fixedPipelineOpenGLSDL.cpp)

target_link_libraries(fixedPipelineOpenGLSDL PRIVATE OpenGL::GL SDL2::SDL2 options::options)

add_executable(programmablePipelineOpenGLSDL programmablePipelineOpenGLSDL.cpp)

target_link_libraries(programmablePipelineOpenGLSDL PRIVATE OpenGL::GL SDL2::SDL2 options::options)

add_executable(programmablePipelineGl3wSDL programmablePipelineGl3wSDL.cpp)

target_link_libraries(programmablePipelineGl3wSDL PRIVATE OpenGL::GL SDL2::SDL2 options::options gl3w::gl3w)
set(
demos
fixedPipelineOpenGLSDL
programmablePipelineOpenGLSDL
programmablePipelineGl3wSDL
programmablePipelineSDL2EGL
)

foreach(demo IN LISTS demos)
add_executable(
${demo}
${demo}.cpp
)

target_link_libraries(
${demo}
PRIVATE
OpenGL::GL
gl3w::gl3w
SDL2::SDL2
SDL2::SDL2main
options::options
)

target_compile_definitions(
${demo}
PRIVATE
NOMINMAX
)
endforeach()

if(ENABLE_Qt5)
find_package(Qt5 REQUIRED Widgets)
Expand Down
1 change: 0 additions & 1 deletion opengl/programmablePipelineGl3wSDL.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#define NOMINMAX
#include <array>
#include <string>
#include <cstdlib>
Expand Down
5 changes: 3 additions & 2 deletions opengl/programmablePipelineSDL2EGL.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#include <algorithm>
#include <array>
#include <optional>
#include <string>
#include <cstdlib>
#include <optional>
#include <iostream>
#include <algorithm>
#include <string_view>
// SDL
#include <SDL2/SDL.h>
Expand Down
7 changes: 7 additions & 0 deletions opengl/shaders/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ foreach(sample IN LISTS samples)
PRIVATE
OpenGL::GL
SDL2::SDL2
SDL2::SDL2main
options::options
gl3w::gl3w
)

target_compile_definitions(
${sample}
PRIVATE
NOMINMAX
)
endforeach()

6 changes: 4 additions & 2 deletions opengl/shaders/controlTriangleColorWithMousePosition.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

// STL
#include <array>
#include <algorithm>
#include <optional>
#include <string>
#include <cstdlib>
#include <optional>
#include <iostream>
#include <algorithm>
#include <string_view>
// GLM
#include <glm/vec4.hpp>
Expand Down
5 changes: 3 additions & 2 deletions opengl/shaders/drawCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#include <array>
#include <algorithm>
#include <optional>
#include <string>
#include <cstdlib>
#include <optional>
#include <iostream>
#include <algorithm>
#include <string_view>
// GLM
#include <glm/vec4.hpp>
Expand Down
5 changes: 3 additions & 2 deletions opengl/shaders/drawCubeWithPerspective.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#include <array>
#include <algorithm>
#include <optional>
#include <string>
#include <cstdlib>
#include <optional>
#include <iostream>
#include <algorithm>
#include <string_view>
// GLM
#include <glm/vec4.hpp>
Expand Down
5 changes: 3 additions & 2 deletions opengl/shaders/drawRedPointShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#include <array>
#include <algorithm>
#include <optional>
#include <string>
#include <cstdlib>
#include <optional>
#include <iostream>
#include <algorithm>
#include <string_view>
// GLM
#include <glm/vec4.hpp>
Expand Down
5 changes: 3 additions & 2 deletions opengl/shaders/drawRedTriangleShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#include <array>
#include <algorithm>
#include <optional>
#include <string>
#include <cstdlib>
#include <optional>
#include <iostream>
#include <algorithm>
#include <string_view>
// GLM
#include <glm/vec4.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#include <array>
#include <algorithm>
#include <optional>
#include <string>
#include <cstdlib>
#include <optional>
#include <iostream>
#include <algorithm>
#include <string_view>
// GLM
#include <glm/vec4.hpp>
Expand Down
5 changes: 3 additions & 2 deletions opengl/shaders/drawTriangleUsingAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#include <array>
#include <algorithm>
#include <optional>
#include <string>
#include <cstdlib>
#include <optional>
#include <iostream>
#include <algorithm>
#include <string_view>
// GLM
#include <glm/vec4.hpp>
Expand Down

0 comments on commit 70460ad

Please sign in to comment.