Skip to content

Commit

Permalink
WebPreviewTool: Feature parity with old preview tool
Browse files Browse the repository at this point in the history
excluding domain warp visualise
  • Loading branch information
Auburn committed Oct 10, 2023
1 parent ec72f1a commit 0d471ec
Show file tree
Hide file tree
Showing 3 changed files with 407 additions and 87 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AccessModifierOffset: -4
AlignOperands: false
AlignTrailingComments: false
AlwaysBreakTemplateDeclarations: Yes
PointerAlignment: Left
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
Expand Down
20 changes: 17 additions & 3 deletions WebPreviewApp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7.1)
cmake_minimum_required(VERSION 3.12)

project(FastNoiseLitePreview VERSION 1.0)
SET(CMAKE_CXX_STANDARD 11)
project(FastNoiseLitePreview VERSION 1.1.0)
SET(CMAKE_CXX_STANDARD 17)

include(FetchContent)

Expand All @@ -12,6 +12,12 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(imgui_application)

FetchContent_Declare(
emscripten-browser-file
GIT_REPOSITORY https://github.com/Armchair-Software/emscripten-browser-file
GIT_TAG 2ff8f8f791c0e7177b40e621ee3f758e03b31bf5
)
FetchContent_MakeAvailable(emscripten-browser-file)
# ----------------------------------------------------------

add_executable(${CMAKE_PROJECT_NAME}
Expand All @@ -20,9 +26,14 @@ add_executable(${CMAKE_PROJECT_NAME}

target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC
${IMGUI_APPLICATION_INCLUDE_DIRECTORIES}
${emscripten-browser-file_SOURCE_DIR}
../Cpp
)

target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC
FNL_VERSION="v${CMAKE_PROJECT_VERSION}"
)

if(EMSCRIPTEN)

# IMPORTANT NOTE: due to `target_link_options` deduplication,
Expand All @@ -37,6 +48,9 @@ if(EMSCRIPTEN)
-sUSE_WEBGL2=1
#-sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 # Only target for WebGL2 (drop support for WebGL1 to save code size)

-sEXPORTED_RUNTIME_METHODS=[ccall]
-sEXPORTED_FUNCTIONS=[_main,_malloc,_free]

-sALLOW_MEMORY_GROWTH=1
-sDISABLE_EXCEPTION_CATCHING=1 -sNO_EXIT_RUNTIME=0 -sASSERTIONS=1

Expand Down
Loading

0 comments on commit 0d471ec

Please sign in to comment.