Skip to content

Commit

Permalink
Make it work on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
schroedtert committed Jan 16, 2024
1 parent ae8bbca commit 92c0f17
Show file tree
Hide file tree
Showing 12 changed files with 5,778 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Project setup
################################################################################
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
project(JuPedSim VERSION 1.1.0 LANGUAGES CXX)
project(JuPedSim VERSION 1.1.0 LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
1 change: 1 addition & 0 deletions jps-ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ target_link_libraries(jps-ui
imgui
imgui_filedialog
glm
glad
)

target_compile_definitions(jps-ui PUBLIC
Expand Down
3 changes: 2 additions & 1 deletion jps-ui/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "shader.hpp"
#include "wkt.hpp"

#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <OpenGL/OpenGL.h>
#include <geos_c.h>
#include <glm/ext/matrix_clip_space.hpp>
#include <glm/vec3.hpp>
Expand Down Expand Up @@ -91,6 +91,7 @@ int main(int argc, char** argv)

/* Make the window's context current */
glfwMakeContextCurrent(window);
gladLoadGL();
glfwSwapInterval(1);

IMGUI_CHECKVERSION();
Expand Down
1 change: 0 additions & 1 deletion jps-ui/src/shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "shader.hpp"

#include <OpenGL/OpenGL.h>
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>

Expand Down
3 changes: 2 additions & 1 deletion jps-ui/src/shader.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright © 2024 Forschungszentrum Jülich GmbH
// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once

#include <glad/glad.h>
#include <GLFW/glfw3.h>

#include <glm/glm.hpp>

#include <stdexcept>
#include <string>
#include <string_view>
#include <unordered_map>

class Shader
{
Expand Down
1 change: 0 additions & 1 deletion jps-ui/src/wkt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "wkt.hpp"
#include "aabb.hpp"

#include <OpenGL/OpenGL.h>
#include <geos_c.h>
#include <glm/glm.hpp>

Expand Down
3 changes: 2 additions & 1 deletion jps-ui/src/wkt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polygon_with_holes_2.h>

#include <OpenGL/OpenGL.h>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <geos_c.h>

#include <array>
Expand Down
1 change: 1 addition & 0 deletions third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ endif()
# DearImGui / ImGuiFileDialog
################################################################################
if(BUILD_JPS_UI)
add_subdirectory(glad)
set(BUILD_SHARED_LIBS_BEFORE ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)
find_package(OpenGL REQUIRED)
Expand Down
7 changes: 7 additions & 0 deletions third-party/glad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_library(glad STATIC
glad/glad.h
glad/glad.c
glad/khrplatform.h
)

target_include_directories(glad PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Loading

0 comments on commit 92c0f17

Please sign in to comment.