Add GLAD OpenGL - function-loader library

The GLAD function loader library  is necessary for the renderer. While
it is possible to write one by hand, GLAD gets generated out of the GL
specification and works just fine.
This commit is contained in:
Eric-Paul Ickhorn 2024-09-09 21:29:17 +02:00
parent 79415a2929
commit 19a7ac57ba
3 changed files with 4275 additions and 2 deletions

2804
dependencies/inc-c/glad/glad.h vendored Normal file

File diff suppressed because it is too large Load Diff

1451
dependencies/src-c/glad.c vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,20 @@ function list_sources() {
cd $ENTRY_PATH cd $ENTRY_PATH
} }
function build_dependencies() {
SOURCES=$(list_sources $PROJECT_PATH/dependencies/src-c)
mkdir -p .build/dependencies
rm -f .build/dependencies/*.o
for SOURCE in $SOURCES
do
OBJECT_NAME=$(make_object_name $SOURCE)
gcc -c -o $PROJECT_PATH/.build/dependencies/$OBJECT_NAME \
$PROJECT_PATH/dependencies/src-c/$SOURCE \
-I $PROJECT_PATH/dependencies/inc-c
done
ar -rvs $PROJECT_PATH/.build/archives/voxula-dependencies.a $PROJECT_PATH/.build/dependencies/*.o
}
function make_include_statements() { function make_include_statements() {
MODULE_NAME=$1 MODULE_NAME=$1
@ -66,7 +80,9 @@ function build_single_module() {
do do
echo "> $SOURCE" echo "> $SOURCE"
OBJECT_NAME=$(make_object_name $SOURCE) OBJECT_NAME=$(make_object_name $SOURCE)
gcc -c -o .build/modules/$MODULE_NAME/objects/$OBJECT_NAME -g3 modules/$MODULE_NAME/src-c/$SOURCE $INCLUDE_STATEMENTS gcc -c -o .build/modules/$MODULE_NAME/objects/$OBJECT_NAME \
-g3 -Wall -Wextra -Wpedantic \
modules/$MODULE_NAME/src-c/$SOURCE $INCLUDE_STATEMENTS
done done
if [[ $(ls .build/modules/$MODULE_NAME/objects/ | grep ".o$") == "" ]]; if [[ $(ls .build/modules/$MODULE_NAME/objects/ | grep ".o$") == "" ]];
@ -82,10 +98,12 @@ function build_single_module() {
mkdir -p .build/archives mkdir -p .build/archives
rm -f .build/archives/*.a rm -f .build/archives/*.a
build_dependencies
MODULE_LIST=$(list_modules "modules") MODULE_LIST=$(list_modules "modules")
for MODULE in $MODULE_LIST for MODULE in $MODULE_LIST
do do
build_single_module $MODULE build_single_module $MODULE
done done
gcc -g3 -o voxula .build/archives/*.a gcc -g3 -o voxula .build/archives/*.a .build/archives/*.a -lSDL2 -lGL