Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3 from headupinclouds/pr.msvc.fixes
Browse files Browse the repository at this point in the history
Pr.msvc.fixes
  • Loading branch information
headupinclouds authored Nov 12, 2016
2 parents ebe4e0b + 09b8a44 commit 54a6674
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 13 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,13 @@
*.class

# emacs noise
*~
*~

# Hunter/polly
_logs/*
_builds/*
_install/*
_framework/*
_archives/*

_bin/*
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
## #################################################################
Expand All @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -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@")
7 changes: 7 additions & 0 deletions ogles_gpgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/..>"
Expand Down
2 changes: 2 additions & 0 deletions ogles_gpgpu/common/common_includes.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions ogles_gpgpu/common/macros.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions ogles_gpgpu/common/proc/base/procinterface.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "../../gl/memtransfer.h"

#include <functional>

BEGIN_OGLES_GPGPU

/**
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ogles_gpgpu/common/proc/fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion ogles_gpgpu/platform/opengl/gl_includes.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

//define something for Windows (64-bit)
#if defined(_WIN32) || defined(_WIN64)
# include <windows.h>
# include <algorithm> // min/max
# include <windows.h> // CMakeLists.txt defines NOMINMAX
# include <gl/glew.h>
# include <GL/gl.h>
# include <GL/glu.h>
#elif __APPLE__
Expand Down

0 comments on commit 54a6674

Please sign in to comment.