Skip to content

Commit

Permalink
Merge pull request #10 from caseymcc/region_renderer
Browse files Browse the repository at this point in the history
early region rendering, with ci
  • Loading branch information
caseymcc authored Nov 7, 2018
2 parents 9f715a6 + a5dbd2e commit 3b599a5
Show file tree
Hide file tree
Showing 99 changed files with 19,225 additions and 6,757 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/_buildx64
/_build
/build
/buildx64
/worlds
/.vscode
162 changes: 162 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# OSX/Linux (https://github.com/travis-ci-tester/toolchain-table)

language:
- cpp

# Container-based infrastructure (Linux)
# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-can-I-use-container-based-infrastructure%3F
sudo:
- false

# Install packages differs for container-based infrastructure
# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-do-I-install-APT-sources-and-packages%3F
# List of available packages:
# * https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-trusty
# List of available sources:
# * https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- python3-pip
- g++-7

dist:
- trusty

env:
global:
- secure: "n3rkI7uJHsJG6UldLClk4sOAXUF/zhVrU04Kgl5YxT9XZn8HZHyyrh6anWIpTolu1omSTKVoAPg/C1B0TqzvOE97cel9tCXPhfShbUmijmdMAY81dg6pIuOzc+p4M31R5oB8TUJs5nnkdCxB/lzmn3lMTePnqLHw8zGxnybHLsf3QDAm1jjIRR0by0LJ1HKP3HExyuaD9kh/m3YwUhJ6ZUPuNdk+HevvMN+zxY5e+kVdnj5krRbMppZDH5TvD96QifIO9ykt+i8UemfnTUXW07nvha6UxCH1ByueKfaSl7rT7Ng/l72N36rJG2wTiXy26NoL6SiTdobt6HweQPOiIj8IRWaw6PZ7LDlaC+0ppBo9HiCZ6iom7UpNEQ30MZN1JwLuZBC2GXJHfEGUn2Kda2c56AHMqd/ZOADHSNbr+PtoMBNvT+5ShUq3oyd+/eC82i4w7z2hH0L72RT5Scbt51fb8nS39tW+/2Jvp/zoV3XTE9TT8rs+M4wzplkVy6F/b5L0h06Kq5kfLvpc1IxelzVd/5tevEtAmkVDy+5BxinAhI/hYOpsYwvgMcYZSytzRjhwIxKcwKqsk+cqXR7nAMr0ciPQ7T3MADfy/h7kBUggOyO06xdWjfue100rNVrlyY/zSIixIEq2FaMVYKZZyGkH8FnXDcmaTVZPFmH4B/k="


matrix:
include:
# Linux {

- os: linux
env: >
TOOLCHAIN=clang-cxx17
PROJECT_DIR=./
#glm issue
# - os: linux
# env: >
# TOOLCHAIN=gcc-7-cxx17
# PROJECT_DIR=./

- os: linux
env: >
TOOLCHAIN=gcc-7-cxx14
PROJECT_DIR=./
#cant find opengl
# - os: linux
# env: >
# TOOLCHAIN=android-ndk-r17-api-21-arm64-v8a-neon-clang-libcxx14
# PROJECT_DIR=./

#error compiling xproto
# - os: linux
# env: >
# TOOLCHAIN=analyze-cxx17
# PROJECT_DIR=./

#error compiling xproto
# - os: linux
# env: >
# TOOLCHAIN=sanitize-address-cxx17
# PROJECT_DIR=./

#error compiling xproto
# - os: linux
# env: >
# TOOLCHAIN=sanitize-leak-cxx17
# PROJECT_DIR=./

#error compiling xproto
# - os: linux
# env: >
# TOOLCHAIN=sanitize-thread-cxx17
# PROJECT_DIR=./

# }

# OSX {

# - os: osx
# osx_image: xcode9.4
# env: >
# TOOLCHAIN=osx-10-13-make-cxx14
# PROJECT_DIR=./
#
# - os: osx
# osx_image: xcode9.4
# env: >
# TOOLCHAIN=osx-10-13-cxx14
# PROJECT_DIR=./

#glfw fails
# - os: osx
# osx_image: xcode9.4
# env: >
# TOOLCHAIN=ios-nocodesign-11-4-dep-9-3
# PROJECT_DIR=./

# }

install:
# Info about OS
- uname -a

# Info about available disk space
- df -h $HOME

# Disable autoupdate
# * https://github.com/Homebrew/brew/blob/7d31a70373edae4d8e78d91a4cbc05324bebc3ba/Library/Homebrew/manpages/brew.1.md.erb#L202
- export HOMEBREW_NO_AUTO_UPDATE=1

# Install Python 3
- if [[ "`uname`" == "Darwin" ]]; then travis_retry brew upgrade python || echo "Ignoring failure..."; fi
- if [[ "`uname`" == "Darwin" ]]; then travis_retry brew install python3; fi

# Install Python package 'requests'
# 'easy_install3' is not installed by 'brew install python3' on OS X 10.9 Maverick
- if [[ "`uname`" == "Darwin" ]]; then pip3 install requests; fi
- if [[ "`uname`" == "Darwin" ]]; then pip3 install gitpython; fi
- if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user requests; fi
- if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user gitpython; fi

# Install latest Polly toolchains and scripts
- wget https://github.com/ruslo/polly/archive/master.zip
- unzip master.zip
- POLLY_ROOT="`pwd`/polly-master"
- export PATH="${POLLY_ROOT}/bin:${PATH}"

# Install dependencies (CMake, Android NDK)
- install-ci-dependencies.py --prune-archives

# Tune locations
- export PATH="`pwd`/_ci/cmake/bin:${PATH}"

# Installed if toolchain is Android (otherwise directory doesn't exist)
- export ANDROID_NDK_r10e="`pwd`/_ci/android-ndk-r10e"
- export ANDROID_NDK_r11c="`pwd`/_ci/android-ndk-r11c"
- export ANDROID_NDK_r15c="`pwd`/_ci/android-ndk-r15c"
- export ANDROID_NDK_r16b="`pwd`/_ci/android-ndk-r16b"
- export ANDROID_NDK_r17="`pwd`/_ci/android-ndk-r17"

script:
- python3 ./jenkins.py

# https://docs.travis-ci.com/user/customizing-the-build/#Whitelisting-or-blacklisting-branches
branches:
except:
- /^pr\..*/
- /^v[0-9]+\.[0-9]+\.[0-9]+$/

git:
submodules: false

#before_script:
# git submodule update --init {submodule}
115 changes: 97 additions & 18 deletions CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,52 @@ option(VOXIGEN_TEXTURE "Setup texture classes" ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
message(STATUS "Module path:${CMAKE_MODULE_PATH}")

set(HUNTER_STATUS_DEBUG ON)
set(
HUNTER_CACHE_SERVERS
"https://github.com/huntercache/voxigen"
CACHE
STRING
"Default cache server"
)

string(COMPARE EQUAL "$ENV{TRAVIS}" "true" is_travis)
string(COMPARE EQUAL "$ENV{APPVEYOR}" "True" is_appveyor)
string(COMPARE EQUAL "$ENV{GITHUB_USER_PASSWORD}" "" password_is_empty)

if((is_travis OR is_appveyor) AND NOT password_is_empty)
option(HUNTER_RUN_UPLOAD "Upload cache binaries" ON)
endif()
message(STATUS "Hunter upload: ${HUNTER_RUN_UPLOAD}")

set(
HUNTER_PASSWORDS_PATH
"${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/passwords.cmake"
CACHE
FILEPATH
"Hunter passwords"
)

#include(HunterPackage)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/HunterGate.cmake)

HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.19.208.tar.gz"
SHA1 "4128ac8c79c21b250bf825e8119ce0bff05e5132"
LOCAL
URL "https://github.com/ruslo/hunter/archive/v0.23.34.tar.gz"
SHA1 "70287b1ffa810ee4e952052a9adff9b4856d0d54"
)

#HunterGate(
# URL "https://github.com/ruslo/hunter/archive/v0.23.16.tar.gz"
# SHA1 "dbe5b1c966414c4a055983c11d5251a2d8f2f16d"
# LOCAL
#)

#HunterGate(
# URL "https://github.com/ruslo/hunter/archive/v0.19.208.tar.gz"
# SHA1 "4128ac8c79c21b250bf825e8119ce0bff05e5132"
# LOCAL
#)

project(voxigen)

#setup build folders
Expand Down Expand Up @@ -55,14 +92,14 @@ if(VOXIGEN_TEXTURE)
hunter_add_package(PNG)
find_package(PNG)

set(IMGLIB_USE_BOOST_FILESYSTEM ON)
set(IMGLIB_USE_COMPILETIME_TYPE OFF)
set(IMGLIB_USE_PNG ON)
set(IMGLIB_USE_EIGEN ON)
set(IMGLIB_USE_OPENCL OFF)
set(IMGLIB_USE_OPENCL_CPP OFF)
set(IMGLIB_USE_CUDA OFF)
set(IMGLIB_BUILD_TEST OFF)
set(IMGLIB_USE_BOOST_FILESYSTEM ON CACHE BOOL "Turn on/off support boost filesystem")
set(IMGLIB_USE_COMPILETIME_TYPE OFF CACHE BOOL "Turn on/off support for compile time type informat")
set(IMGLIB_USE_PNG ON CACHE BOOL "Turn on/off support for PNG")
set(IMGLIB_USE_EIGEN ON CACHE BOOL "Turn on/off support for eigen library")
set(IMGLIB_USE_OPENCL OFF CACHE BOOL "Turn on/off support for OpenCl")
set(IMGLIB_USE_OPENCL_CPP OFF CACHE BOOL "Turn on/off support for OpenCl CPP classes")
set(IMGLIB_USE_CUDA OFF CACHE BOOL "Turn on/off support for CUDA")
set(IMGLIB_BUILD_TEST OFF CACHE BOOL "Turns on test application")

add_subdirectory(imglib)
set_target_properties(imglib PROPERTIES FOLDER Libraries)
Expand All @@ -87,7 +124,7 @@ if(USE_OCTOMAP)
set_target_properties (octomath-static PROPERTIES FOLDER Libraries)
endif()

if(MSVC)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions(-DNOMINMAX)
endif()

Expand All @@ -110,6 +147,8 @@ set(voxigen_headers
include/voxigen/faces.h
include/voxigen/generator.h
include/voxigen/gridDescriptors.h
include/voxigen/handleState.h
include/voxigen/heightmapMeshBuilder.h
include/voxigen/initGlew.h
include/voxigen/jsonSerializer.h
include/voxigen/object.h
Expand All @@ -118,21 +157,26 @@ set(voxigen_headers
include/voxigen/regularGrid.h
include/voxigen/region.h
include/voxigen/regionHandle.h
include/voxigen/renderAction.h
include/voxigen/renderCube.h
include/voxigen/renderPrepThread.h
include/voxigen/search.h
include/voxigen/simpleCamera.h
include/voxigen/simpleChunkRenderer.h
include/voxigen/simpleFilesystem.h
include/voxigen/simpleRegionRenderer.h
include/voxigen/simpleRenderer.h
include/voxigen/simpleShapes.h
)

set(voxigen_inline
include/voxigen/chunkHandle.inl
include/voxigen/processQueue.inl
include/voxigen/renderCube.inl
include/voxigen/renderPrepThread.inl
include/voxigen/regionHandle.inl
include/voxigen/simpleChunkRenderer.inl
include/voxigen/simpleRegionRenderer.inl
include/voxigen/simpleRenderer.inl
)

Expand All @@ -153,7 +197,6 @@ set(voxigen_sources


set(voxigen_public_libraries
opengl_util
fastNoise
glew::glew
Boost::filesystem
Expand All @@ -164,6 +207,7 @@ set(voxigen_public_libraries
)

set(voxigen_libraries ${voxigen_public_libraries}
opengl_util
glm
RapidJSON::rapidjson
)
Expand All @@ -174,6 +218,7 @@ if(VOXIGEN_TEXTURE)
include/voxigen/chunkTextureMesh.h
include/voxigen/layerMethod.h
include/voxigen/textureAtlas.h
include/voxigen/texturedMesh.h
include/voxigen/texturePack.h
)

Expand Down Expand Up @@ -201,7 +246,7 @@ if(VOXIGEN_OUTPUT_DIRECTORY_RELEASE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${VOXIGEN_OUTPUT_DIRECTORY_RELEASE})
endif()

if(MSVC)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_library(voxigen SHARED
${voxigen_headers}
${voxigen_inline}
Expand All @@ -215,11 +260,42 @@ add_library(voxigen STATIC
)
endif()

#if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# target_compile_definitions(voxigen PUBLIC GLM_FORCE_EXPLICIT_CTOR)
# if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
# target_compile_options(voxigen PUBLIC "-lstdc++fs")
# else()
# target_compile_options(voxigen PUBLIC "-lstdc++fs")
# endif()
#endif()

if(TARGET fastNoise_sse2)
add_dependencies(voxigen fastNoise_sse2)
set_target_properties(fastNoise_sse2 PROPERTIES FOLDER Libraries)
endif()
if(TARGET fastNoise_sse41)
add_dependencies(voxigen fastNoise_sse41)
set_target_properties(fastNoise_sse41 PROPERTIES FOLDER Libraries)
endif()
if(TARGET fastNoise_avx2)
add_dependencies(voxigen fastNoise_avx2)
set_target_properties(fastNoise_avx2 PROPERTIES FOLDER Libraries)
endif()
if(TARGET fastNoise_avx512)
add_dependencies(voxigen fastNoise_avx512)
set_target_properties(fastNoise_avx512 PROPERTIES FOLDER Libraries)
endif()

source_group("Source Files" FILES ${voxigen_inline})
include_directories(${CMAKE_CURRENT_LIST_DIR}/include)

target_link_libraries(voxigen ${voxigen_libraries})

#if(APPLE)
# target_include_directories(voxigen PUBLIC "/opt/X11/include")
# target_link_libraries(voxigen X11)
#endif()

#test app
set(testApp_sources
testApp/main.cpp
Expand All @@ -234,8 +310,11 @@ foreach(target ${voxigen_public_libraries})
endforeach()
set(VS_WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})

configure_file(testApp/project.vcxproj.user.in ${CMAKE_BINARY_DIR}/testApp.vcxproj.user.config @ONLY)
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/testApp.vcxproj.user INPUT ${CMAKE_BINARY_DIR}/testApp.vcxproj.user.config)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
configure_file(testApp/project.vcxproj.user.in ${CMAKE_BINARY_DIR}/launcher/testApp.vcxproj.user.config @ONLY)
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/testApp.vcxproj.user INPUT ${CMAKE_BINARY_DIR}/launcher/testApp.vcxproj.user.config CONDITION $<CONFIG:Debug>)
else()
configure_file(testApp/run.in ${CMAKE_BINARY_DIR}/launcher/run.config @ONLY)
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/run$<IF:$<STREQUAL:CONFIG,"">,,_$<CONFIG>>.sh INPUT ${CMAKE_BINARY_DIR}/launcher/run.config)
endif()

configure_file(testApp/run.in ${CMAKE_BINARY_DIR}/run.config @ONLY)
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/run_$<CONFIG>.sh INPUT ${CMAKE_BINARY_DIR}/run.config)
Loading

0 comments on commit 3b599a5

Please sign in to comment.