From cc0b078e17bfde85781dc3c7e2b108c628e671ad Mon Sep 17 00:00:00 2001 From: mitchellhansen Date: Tue, 12 Dec 2017 22:23:14 -0800 Subject: [PATCH] changed the paths in cmake, fixed two dumb sigabrts on termination --- CMakeLists.txt | 6 +++++- src/Application.cpp | 8 +++++--- src/CLCaster.cpp | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f86013b..735e316 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,11 @@ if (WIN32) set(SFML_INCLUDE_DIR ${SFML_ROOT}/include) endif() -set(OPENGL_LIBRARIES "/opt/amdgpu-pro/lib/x86_64-linux-gnu") +# You're probably going to need to change these paths +if (UNIX) + set(OpenCL_INCLUDE_DIR /usr/include/CL) + set(OpenCL_LIBRARY /usr/lib/x86_64-linux-gnu/libOpenCL.so.1) +endif (UNIX) set(SFML_COMPONENTS graphics window system network audio) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/Application.cpp b/src/Application.cpp index 10e0756..18a742b 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -18,8 +18,8 @@ Application::Application() { Application::~Application() { - light_handle->~LightHandle(); - light_controller->~LightController(); + //light_handle->~LightHandle(); + //light_controller->~LightController(); } bool Application::init_clcaster() { @@ -98,13 +98,15 @@ bool Application::init_events() { bool Application::game_loop() { - while (window->isOpen()) { + while (true) { // Have the input handler empty the event stack, generate events for held keys, and then dispatch the events to listeners input_handler.consume_sf_events(window.get()); input_handler.handle_held_keys(); input_handler.dispatch_events(); + if (!window->isOpen()) + break; // Time keeping elapsed_time = elap_time(); delta_time = elapsed_time - current_time; diff --git a/src/CLCaster.cpp b/src/CLCaster.cpp index dc008e6..a5d16b8 100644 --- a/src/CLCaster.cpp +++ b/src/CLCaster.cpp @@ -1,7 +1,10 @@ #include "CLCaster.h" CLCaster::CLCaster() {} -CLCaster::~CLCaster() {} +CLCaster::~CLCaster() { + delete[] viewport_matrix; + delete[] viewport_image; +} bool CLCaster::init() {