diff --git a/.gitignore b/.gitignore index 306ab8f..f2cf8ed 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,13 @@ *.class # emacs noise -*~ \ No newline at end of file +*~ + +# Hunter/polly +_logs/* +_builds/* +_install/* +_framework/* +_archives/* + +_bin/* diff --git a/CMakeLists.txt b/CMakeLists.txt index a1a1f73..332be09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,10 +29,19 @@ if(XCODE) set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configuration types") endif() +option(OGLES_GPGPU_BUILD_EXAMPLES "Build examples" OFF) +option(OGLES_GPGPU_INSTALL "Perform installation" ON) +option(OGLES_GPGPU_VERBOSE "Perform per filter logging" OFF) + ## ################################################################# ## Dependencies - OpenGL stuff ## ################################################################# +if(MSVC) + hunter_add_package(glew) + find_package(glew CONFIG REQUIRED) +endif() + ## ################################################################# ## Project ## ################################################################# @@ -43,11 +52,6 @@ add_subdirectory(ogles_gpgpu) ## Examples ## ################################################################# -option(OGLES_GPGPU_BUILD_EXAMPLES "Build examples" OFF) -option(OGLES_GPGPU_INSTALL "Perform installation" OFF) -option(OGLES_GPGPU_VERBOSE "Perform per filter logging" OFF) - -message("OGLES_GPGPU_BUILD_EXAMPLES ${OGLES_GPGPU_BUILD_EXAMPLES}") if(OGLES_GPGPU_BUILD_EXAMPLES) message("BUILD EXAMPLES.......") add_subdirectory(examples) diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in index 9b4c9ee..dd16904 100644 --- a/cmake/Config.cmake.in +++ b/cmake/Config.cmake.in @@ -1,4 +1,10 @@ @PACKAGE_INIT@ +include(CMakeFindDependencyMacro) + +if(@MSVC@) + find_dependency(glew) +endif() + include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") check_required_components("@PROJECT_NAME@") diff --git a/ogles_gpgpu/CMakeLists.txt b/ogles_gpgpu/CMakeLists.txt index 13f14bf..549bf79 100644 --- a/ogles_gpgpu/CMakeLists.txt +++ b/ogles_gpgpu/CMakeLists.txt @@ -10,6 +10,13 @@ endif() if(ANDROID) target_link_libraries(ogles_gpgpu PUBLIC EGL GLESv2) endif() + +if(MSVC) + target_link_libraries(ogles_gpgpu glew::glew) + target_compile_definitions(ogles_gpgpu PUBLIC NOMINMAX) # avoid std::{min,max} conflicts + target_compile_definitions(ogles_gpgpu PUBLIC _USE_MATH_DEFINES) # M_PI, etc +endif() + set_property(TARGET ${library} PROPERTY FOLDER "libs/ogles_gpgpu") target_include_directories( ogles_gpgpu PUBLIC "$" diff --git a/ogles_gpgpu/common/common_includes.h b/ogles_gpgpu/common/common_includes.h old mode 100644 new mode 100755 index 89f6269..046f8a6 --- a/ogles_gpgpu/common/common_includes.h +++ b/ogles_gpgpu/common/common_includes.h @@ -25,6 +25,8 @@ # endif #elif __ANDROID__ || defined(ANDROID) # define OGLES_GPGPU_ANDROID 1 +#elif defined(_WIN32) || defined(_WIN64) +# define OGLES_GPGPU_WINDOWS 1 #endif #ifdef OGLES_GPGPU_IOS diff --git a/ogles_gpgpu/common/macros.h b/ogles_gpgpu/common/macros.h old mode 100644 new mode 100755 index f59bbac..07301e0 --- a/ogles_gpgpu/common/macros.h +++ b/ogles_gpgpu/common/macros.h @@ -14,11 +14,13 @@ #define OG_TO_STR(x) OG_TO_STR_(x) #if defined(OGLES_GPGPU_VERBOSE) -#define OG_LOGINF(class, args...) fprintf(stdout, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stdout, args); fprintf(stdout, "\n") +# define OG_LOGINF(class_tag, fmt, ...) \ + do { fprintf(stderr, "ogles_gpgpu::%s - %s:%d:%s(): " fmt, class_tag, __FILE__, __LINE__, __func__, ##__VA_ARGS__); } while (0) #else -#define OG_LOGINF(class, args...) +# define OG_LOGINF(class_tag, fmt, ...) #endif -#define OG_LOGERR(class, args...) fprintf(stderr, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stderr, args); fprintf(stderr, "\n") +#define OG_LOGERR(class_tag, fmt, ...) \ + do { fprintf(stderr, "ogles_gpgpu::%s - %s:%d:%s(): " fmt, class_tag, __FILE__, __LINE__, __func__, ##__VA_ARGS__); } while (0) #endif diff --git a/ogles_gpgpu/common/proc/base/procinterface.h b/ogles_gpgpu/common/proc/base/procinterface.h old mode 100644 new mode 100755 index cc6709f..ec6b0bc --- a/ogles_gpgpu/common/proc/base/procinterface.h +++ b/ogles_gpgpu/common/proc/base/procinterface.h @@ -17,6 +17,8 @@ #include "../../gl/memtransfer.h" +#include + BEGIN_OGLES_GPGPU /** @@ -216,12 +218,12 @@ class ProcInterface { /** * Process a filter chain: */ - virtual void process(GLuint id, GLuint useTexUnit, GLenum target, int index = 0, int position = 0, Logger logger=0); + virtual void process(GLuint id, GLuint useTexUnit, GLenum target, int index = 0, int position = 0, Logger logger = {}); /** * Process filter chain filter[i] : i >= 1 */ - virtual void process(int position, Logger logger=0); + virtual void process(int position, Logger logger = {}); /** * Allow this proc to use mipmaps diff --git a/ogles_gpgpu/common/proc/fifo.h b/ogles_gpgpu/common/proc/fifo.h index 383b39b..b3af79b 100644 --- a/ogles_gpgpu/common/proc/fifo.h +++ b/ogles_gpgpu/common/proc/fifo.h @@ -58,7 +58,7 @@ class FifoProc : public MultiProcInterface { protected: virtual void prepare(int inW, int inH, int index = 0, int position = 0); - virtual void process(int position, Logger logger=0); + virtual void process(int position, Logger logger = {}); int m_count = 0; int m_inputIndex = -1; diff --git a/ogles_gpgpu/platform/opengl/gl_includes.h b/ogles_gpgpu/platform/opengl/gl_includes.h old mode 100644 new mode 100755 index f350520..9ff0ec9 --- a/ogles_gpgpu/platform/opengl/gl_includes.h +++ b/ogles_gpgpu/platform/opengl/gl_includes.h @@ -13,7 +13,9 @@ //define something for Windows (64-bit) #if defined(_WIN32) || defined(_WIN64) -# include +# include // min/max +# include // CMakeLists.txt defines NOMINMAX +# include # include # include #elif __APPLE__