Compare commits
21 Commits
main
...
3d-project
Author | SHA1 | Date | |
---|---|---|---|
8b95861011 | |||
0485a75de3 | |||
5aaa6d13f8 | |||
3b1f89685a | |||
20027989bb | |||
7236130a30 | |||
c68c82cda7 | |||
0faa71751d | |||
30ed1f679b | |||
18a990133f | |||
cec2cb3ec9 | |||
7e429da9ae | |||
1350d6adf7 | |||
128adb6947 | |||
5c39c62529 | |||
92c55d34d3 | |||
5b4cae40f9 | |||
aacef5d48f | |||
d2db091873 | |||
98aee1a086 | |||
6d2a991c36 |
@ -191,12 +191,14 @@ public:
|
||||
if (type STREQUAL "image")
|
||||
cmake_path(GET file_path PARENT_PATH file_parent)
|
||||
cmake_path(GET file_path FILENAME file_name)
|
||||
exec_program("${ImageMagick_identify_EXECUTABLE}" "${file_parent}"
|
||||
ARGS -format "%[fx:w]" "${file_name}"
|
||||
OUTPUT_VARIABLE image_width)
|
||||
exec_program("${ImageMagick_identify_EXECUTABLE}" "${file_parent}"
|
||||
ARGS -format "%[fx:h]" "${file_name}"
|
||||
OUTPUT_VARIABLE image_height)
|
||||
execute_process(COMMAND "${ImageMagick_identify_EXECUTABLE}" -format "%[fx:w]" "${file_name}"
|
||||
WORKING_DIRECTORY "${file_parent}"
|
||||
OUTPUT_VARIABLE image_width
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
execute_process(COMMAND "${ImageMagick_identify_EXECUTABLE}" -format "%[fx:h]" "${file_name}"
|
||||
WORKING_DIRECTORY "${file_parent}"
|
||||
OUTPUT_VARIABLE image_height
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
file(APPEND "${EMBED_HEADER_DIR}/embed_resources.hpp" "inline EmbededImage embeded_${obj_cleaned_name}(${image_width}, ${image_height}, EmbededResource(&_binary_${obj_cleaned_name}_start, &_binary_${obj_cleaned_name}_end)); \n")
|
||||
|
||||
elseif (type STREQUAL "embed")
|
||||
@ -206,7 +208,7 @@ public:
|
||||
endforeach()
|
||||
set(EMBED_OBJ_RET "${EMBED_OBJ_RET}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
EmbedResources(${SHADILER_OBJ_RET})
|
||||
EmbedResources(${SHADILER_OBJ_RET} "${CMAKE_CURRENT_SOURCE_DIR}/res/debug_north.png")
|
||||
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${EMBED_OBJ_RET})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC "${EMBED_HEADER_DIR}")
|
||||
|
22
generate-lspinfo.sh
Normal file
22
generate-lspinfo.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#/bin/sh -e
|
||||
|
||||
echo "Going to clean your ./build/ , then build cmake to get the commands, then clean your ./build/ again. Turn away now if you do not want this!"
|
||||
echo "Please wait 10 seconds to confirm..."
|
||||
sleep 10s
|
||||
|
||||
SCRIPT_PATH="$(readlink -f "$0")"
|
||||
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
sh clean.sh
|
||||
|
||||
EXT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug"
|
||||
EXT_CMAKE_OPTIONS="$EXT_CMAKE_OPTIONS -DENABLE_ASAN=ON"
|
||||
EXT_CMAKE_OPTIONS="$EXT_CMAKE_OPTIONS -DENABLE_TESTS=OFF"
|
||||
EXT_CMAKE_OPTIONS="$EXT_CMAKE_OPTIONS -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||
cmake $EXT_CMAKE_OPTIONS -S ./ -B ./build/
|
||||
cp -v build/compile_commands.json ./
|
||||
sed -i 's/gnu++23/c++2b/g' ./compile_commands.json
|
||||
|
||||
sh clean.sh
|
BIN
res/debug_north.png
Normal file
BIN
res/debug_north.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 628 B |
@ -19,9 +19,12 @@
|
||||
|
||||
#version 450
|
||||
|
||||
layout(location = 0) out vec4 outColor;
|
||||
layout(location = 0) in vec3 fragColor;
|
||||
layout(location = 0) in vec3 frag_color;
|
||||
layout(location = 1) in vec2 frag_texture_coordinate;
|
||||
layout(binding = 1) uniform sampler2D texture_sampler;
|
||||
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
void main() {
|
||||
outColor = vec4(fragColor, 1.0);
|
||||
out_color = texture(texture_sampler, frag_texture_coordinate);
|
||||
}
|
||||
|
@ -19,21 +19,21 @@
|
||||
|
||||
#version 450
|
||||
|
||||
layout(location = 0) out vec3 fragColor;
|
||||
layout(binding = 0) uniform UniformBufferObject {
|
||||
mat4 model;
|
||||
mat4 view;
|
||||
mat4 proj;
|
||||
} ubo;
|
||||
|
||||
vec2 positions[3] = vec2[](
|
||||
vec2(0.0, -0.5),
|
||||
vec2(0.5, 0.5),
|
||||
vec2(-0.5, 0.5)
|
||||
);
|
||||
layout(location = 0) in vec3 in_position;
|
||||
layout(location = 2) in vec3 in_color;
|
||||
layout(location = 4) in vec2 in_texture_coordinate;
|
||||
|
||||
vec3 colors[3] = vec3[](
|
||||
vec3(1.0, 0.0, 0.0),
|
||||
vec3(0.0, 1.0, 0.0),
|
||||
vec3(0.0, 0.0, 1.0)
|
||||
);
|
||||
layout(location = 0) out vec3 frag_color;
|
||||
layout(location = 1) out vec2 frag_texture_coordinate;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
|
||||
fragColor = colors[gl_VertexIndex];
|
||||
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(in_position, 1.0);
|
||||
frag_color = in_color;
|
||||
frag_texture_coordinate = in_texture_coordinate;
|
||||
}
|
||||
|
1558
src/main.cpp
1558
src/main.cpp
File diff suppressed because it is too large
Load Diff
4
test.sh
4
test.sh
@ -13,6 +13,7 @@ check_failure() {
|
||||
}
|
||||
|
||||
run_and_grep() {
|
||||
echo "Testing Starting: $2"
|
||||
OUTPUT=$($1 2>&1)
|
||||
echo "$OUTPUT" | grep "Completed tests"
|
||||
check_failure "$2"
|
||||
@ -21,6 +22,7 @@ run_and_grep() {
|
||||
|
||||
echo "Testing Debug"
|
||||
sh clean.sh
|
||||
echo "Building Debug..."
|
||||
ENABLE_TESTS=1 ENABLE_DEBUG=1 sh build.sh >/dev/null 2>&1
|
||||
check_failure "Build Debug"
|
||||
time ENABLE_SWRAST=1 run_and_grep "sh run.sh" "Debug CPU Test"
|
||||
@ -28,9 +30,11 @@ time run_and_grep "sh run.sh" "Debug GPU Test"
|
||||
|
||||
echo "Testing Release"
|
||||
sh clean.sh
|
||||
echo "Building Release..."
|
||||
ENABLE_TESTS=1 sh build.sh >/dev/null 2>&1
|
||||
check_failure "Build Release"
|
||||
time ENABLE_SWRAST=1 run_and_grep "sh run.sh" "Release CPU Test"
|
||||
time run_and_grep "sh run.sh" "Release GPU Test"
|
||||
|
||||
sh clean.sh
|
||||
echo "Tests Succeeded"
|
||||
|
Loading…
x
Reference in New Issue
Block a user