Browse Source

feat: update

master
anjingyu 2 years ago
parent
commit
75cfed76ec
7 changed files with 16 additions and 50 deletions
  1. +2
    -1
      svl/CMakeLists.txt
  2. +1
    -0
      sww/.gitignore
  3. +1
    -24
      sww/CMakeLists.txt
  4. +2
    -2
      sww/README.md
  5. +2
    -20
      sww/demos/particle/CMakeLists.txt
  6. +6
    -2
      sww/examples/glfw/scripts/setup.sh
  7. +2
    -1
      sww/source/util.h

+ 2
- 1
svl/CMakeLists.txt View File

@@ -9,7 +9,8 @@ set (CMAKE_CXX_EXTENSIONS OFF)

set (ADMAKE_NEED_EXCEPTION ON)

include (admake)
# include (admake)
include (CMakeListsPub)

# find_package (SDL2 CONFIG REQUIRED)
# find_package (SDL2-image CONFIG REQUIRED)


+ 1
- 0
sww/.gitignore View File

@@ -3,6 +3,7 @@
bin/
lib/
.vscode/
3rd-party/

# C
# Prerequisites


+ 1
- 24
sww/CMakeLists.txt View File

@@ -2,34 +2,11 @@ cmake_minimum_required (VERSION 3.15)

project (sww)

# For IDEs
# When using IDE to open this cmake project, it will never to append the
# argument `CMAKE_MODULE_PATH`, so we must set it in the CMakeLists.txt file
# before including the cmake modules of admake.
if (NOT DEFINED CMAKE_MODULE_PATH)
execute_process (COMMAND admake dirs -c
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _ADMAKE_CODE
OUTPUT_VARIABLE _ADMAKE_CMAKE_DIR
ERROR_VARIABLE _ADMAKE_ERROR)
if (NOT _ADMAKE_CODE EQUAL "0")
message (FATAL_ERROR "Failed to append cmake modules of admake: ${_ADMAKE_ERROR}")
else ()
set (CMAKE_MODULE_PATH "${_ADMAKE_CMAKE_DIR}")
endif ()

set (IN_IDE ON)
endif ()

# Disable sanitizer by default, otherwise the canvas of the window will be filled with
# abnormal data(on the top).
set (ADMAKE_DISABLE_ADDRESS_SANITIZER ON)

include (admake)

if (IN_IDE)
add_compile_definitions (${ADMAKE_OS_DEF})
endif ()
include (CMakeListsPub)

set (TARGET_NAME ${CMAKE_PROJECT_NAME})



+ 2
- 2
sww/README.md View File

@@ -32,7 +32,7 @@ admake rebuild -t
Also try `https://glad.dav1d.de/` for online generation.

``` shell
pip install glad
python -m glad --out-path . --generator c --api gl=4.6 --profile compatibility
pip install glad2
python -m glad --out-path . --generator c --api gl:core=4.6
```


+ 2
- 20
sww/demos/particle/CMakeLists.txt View File

@@ -2,30 +2,12 @@ cmake_minimum_required (VERSION 3.15)

project (skin_smoothing)

# For IDEs
# When using IDE to open this cmake project, it will never to append the
# argument `CMAKE_MODULE_PATH`, so we must set it in the CMakeLists.txt file
# before including the cmake modules of admake.
if (NOT DEFINED CMAKE_MODULE_PATH)
execute_process (COMMAND admake dirs -c
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _ADMAKE_CODE
OUTPUT_VARIABLE _ADMAKE_CMAKE_DIR
ERROR_VARIABLE _ADMAKE_ERROR)
if (NOT _ADMAKE_CODE EQUAL "0")
message (FATAL_ERROR "Failed to append cmake modules of admake: ${_ADMAKE_ERROR}")
else ()
set (CMAKE_MODULE_PATH "${_ADMAKE_CMAKE_DIR}")
endif ()

set (IN_IDE ON)
endif ()

# Disable sanitizer by default, otherwise the canvas of the window will be filled with
# abnormal data(on the top).
set (ADMAKE_DISABLE_ADDRESS_SANITIZER ON)

include (admake)
# include (admake)
include (CMakeListsPub)

if (IN_IDE)
add_compile_definitions (${ADMAKE_OS_DEF})


+ 6
- 2
sww/examples/glfw/scripts/setup.sh View File

@@ -25,6 +25,8 @@ function setup_glad2()
echo -e "Checking ${cyan}GLAD${normal} ..."
if pip list | grep "glad2" 1>/dev/null 2>&1; then
echo -e "${yellow}glad2${normal} is installed"
echo -e "${cyan}Updating ${yellow}glad2${normal} ..."
pip install -U glad2
else
echo -e "Installing ${green}GLAD2${normal} ..."
pip install -y glad2
@@ -32,8 +34,10 @@ function setup_glad2()

# Check the generated GLAD files
if [ ! -d "$THIRD_PARTY_DIR/glad" ]; then
# Generate gfad files
# Generate glad files
mkdir -p "$THIRD_PARTY_DIR/glad"
echo -e "${magenta}Generating GLAD files ...${normal}"
python -m glad --out-path "$THIRD_PARTY_DIR/glad" --api gl:core=4.6 c --loader --mx
fi
}

@@ -65,7 +69,7 @@ function setup_imgui()

function main()
{
if [ ! -d "$THIRD_PARTY_DIR" ];
if [ ! -d "$THIRD_PARTY_DIR" ]; then
mkdir -p "$THIRD_PARTY_DIR"
fi



+ 2
- 1
sww/source/util.h View File

@@ -7,7 +7,8 @@
#define PowFast(x,y) ((x) / ((x) + (y) - (y) * (x)))

// accel/decel curve (a < 0 => decel)
#define AccelerationInterp(double t, double a) ((a) == 0.0 ? (t) : (a) > 0.0? PowFast(t, a) : 1.0 - PowFast(1.0 - (t), -(a)))
// AccelerationInterp(double t, double a)
#define AccelerationInterp(t, a) ((a) == 0.0 ? (t) : (a) > 0.0? PowFast(t, a) : 1.0 - PowFast(1.0 - (t), -(a)))

// normalized linear intep
// Vec3d Vector3Nlerp(const Vec3d& a, const Vec3d& b, double t);


Loading…
Cancel
Save