mitchellhansen 4 years ago
parent 2e2fb9ffd2
commit f83e5290dd

@ -14,6 +14,12 @@ if (WIN32)
set(SFML_INCLUDE_DIR ${SFML_ROOT}/include)
endif()
# 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})
find_package(SFML 2.1 COMPONENTS ${SFML_COMPONENTS} REQUIRED)
@ -87,7 +93,9 @@ foreach (source IN ITEMS ${KERNELS})
endif()
endforeach()
# Link CL, GL, and SFML
target_link_libraries (${PNAME} stdc++fs)
target_link_libraries (${PNAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
target_link_libraries (${PNAME} ${OpenCL_LIBRARY})
target_link_libraries (${PNAME} ${OPENGL_LIBRARIES})
@ -97,5 +105,4 @@ if (NOT WIN32)
endif()
# Setup to use C++14
set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 14)
set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 17)

@ -5,7 +5,7 @@
#include <experimental/filesystem>
#include <vector>
#include <SFML/Graphics.hpp>
#include <cstring>
struct pattern_info {
std::string title;

@ -8,9 +8,11 @@ Decoder::Decoder() {
for (std::experimental::filesystem::directory_entry p : std::experimental::filesystem::directory_iterator("../assets/patterns/")) {
// good lord c++
std::string s = p.path().generic_string();
const char* char_shit = new const char[s.size() + 1];
const char* char_shit = new char[s.size() + 1];
memcpy((void*)char_shit, s.c_str(), s.size()+1);
delete char_shit;
pattern_list.push_back(char_shit);
}

Loading…
Cancel
Save