diff --git a/CMakeLists.txt b/CMakeLists.txt index d1ace8f..0fad5e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,7 @@ add_library(fennec STATIC include/fennec/math/detail/__fwd.h include/fennec/math/detail/__types.h include/fennec/math/detail/__vector_traits.h + include/fennec/lang/lang.h ) add_subdirectory(metaprogramming) @@ -100,9 +101,12 @@ add_subdirectory(test) # DOXYGEN ============================================================================================================== # https://vicrucann.github.io/tutorials/quick-cmake-doxygen/ +file(COPY logo DESTINATION docs/logo) + find_package(Doxygen) if(DOXYGEN_FOUND) + set(DOXY_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/docs") get_filename_component(DOXYGEN_PROJECT_NAME ${PROJECT_SOURCE_DIR} NAME) # Set Doxy Project name to the name of the root dir set(DOXYGEN_CONFIG_IN "${PROJECT_SOURCE_DIR}/doxy/Doxyfile.in") # Input config file with preprocessor arguments set(DOXYGEN_CONFIG_OUT "${PROJECT_SOURCE_DIR}/doxy/Doxyfile") # Generated config file from input @@ -110,10 +114,13 @@ if(DOXYGEN_FOUND) configure_file(${DOXYGEN_CONFIG_IN} ${DOXYGEN_CONFIG_OUT} @ONLY) # Execute preprocessing step message("Doxygen Build Started.") + # Target for building docs add_custom_target(fennecdocs ALL COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIG_OUT} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/logo/raster.png + ${DOXY_OUTPUT_DIR}/logo/raster.png COMMENT "Generating Doxygen Documentation" VERBATIM) diff --git a/README.md b/README.md index 344ed6a..949686e 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,44 @@

-drawing -
+

fennec

-

a free and open source game engine

-
+
a free and open source game engine


## Table of Contents + 1. [Introduction](#introduction) 2. [Building from Source](#building-from-source) 1. [Building from Terminal](#building-from-terminal) 2. [Building on Windows](#building-on-windows) 3. [Running the Test Suite](#running-the-test-suite) - + 3. [Usage](#usage) + 4. [Contribution](#contribution)

+ + ## Introduction fennec is designed to be a general purpose, educational game engine. Interfacing with the API in C++ follows the [GNU Coding Standards](https://www.gnu.org/prep/standards/html_node/index.html). -Some main areas where the engine strays from the GNU standard includes the following: +fennec may be used both through the provided editor application, or as a standalone +library link against your application. Some main areas where the engine strays from +the GNU standard includes the following: - [Section 4.7, Standards for Graphical Interfaces](https://www.gnu.org/prep/standards/html_node/Graphical-Interfaces.html). fennec provides an implementation for X11, however it does not use the GTK toolkit. +- [Section 6.1, GNU Manuals](https://www.gnu.org/prep/standards/html_node/GNU-Manuals.html) + fennec does not use Texinfo and instead uses Doxygen. Otherwise, it follows the other standards of this section. +- [Section 7, The Release Process](https://www.gnu.org/prep/standards/html_node/Managing-Releases.html) + fennec follows most of the conventions in this section, however the build system used is CMake and not + Makefile. CMake, although overwhelming at first, is much more friendly to those who are learning build systems for the first time.
@@ -37,16 +46,16 @@ The C++ stdlib is reimplemented in the fennec engine. There are a few reasons for this: 1. Standardize implementations across compilers - 2. Set proper naming conventions, i.e. `std::vector`->`fennec::dynarray` + 2. Set proper naming conventions, i.e. `std::vector` → `fennec::dynarray` 3. Optimize compilation times, binary size, and performance. 4. Inject debugging information when necessary. 5. Expose functionality in a readable manner for those interested in learning the intricacies of the implementation. - -
+ + ## Building from Source fennec uses the CMake build system. The CMake build script provides several @@ -68,6 +77,7 @@ is also a viable IDE but involves some extra setup.
+ ### Building from Terminal `build.sh` provides profiles for building the main engine. Run `./build.sh --help` @@ -80,6 +90,7 @@ for available generators](https://cmake.org/cmake/help/latest/manual/cmake-gener
+ ### Building on Windows The bash script can be run natively on Windows when WSL is enabled. You do not @@ -123,6 +134,7 @@ cmake -G "Visual Studio 17 2022" -A x64

+ ## Running the Test Suite `test.sh` provides profiles for building the test suite and executes them. @@ -130,4 +142,21 @@ cmake -G "Visual Studio 17 2022" -A x64 By default, it runs in debug mode and the first failed test will throw an assertion. Any tests that involve running as an application will spawn a subprocess with a window, and give a short description of the behaviour in the terminal. It will then have you confirm -whether the information displayed is correct. \ No newline at end of file +whether the information displayed is correct. + +
+
+ + +## Usage + +
+
+ + +## Contribution + +There are some principles to keep in mind when contributing to fennec. + +1. You must follow the style guide provided by the [GNU Coding Standard](https://www.gnu.org/prep/standards/html_node/Writing-C.html). +2. Any changes must allow all projects to be forward compatible with newer engine verisons. \ No newline at end of file diff --git a/doxy/Doxyfile b/doxy/Doxyfile index 09a8768..52d9f29 100644 --- a/doxy/Doxyfile +++ b/doxy/Doxyfile @@ -68,7 +68,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = /home/medusa/Documents/Work/Personal/fennec/docs/ +OUTPUT_DIRECTORY = /home/medusa/Documents/Work/Personal/fennec/docs # If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 # sub-directories (in 2 levels) under the output directory of each output format @@ -944,7 +944,8 @@ WARN_LOGFILE = # Note: If this tag is empty the current directory is searched. INPUT = "/home/medusa/Documents/Work/Personal/fennec/include/" \ - "/home/medusa/Documents/Work/Personal/fennec/source/" + "/home/medusa/Documents/Work/Personal/fennec/source/" \ + "/home/medusa/Documents/Work/Personal/fennec/README.md" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1159,7 +1160,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = "/home/medusa/Documents/Work/Personal/fennec/README.md" # The Fortran standard specifies that for fixed formatted Fortran code all # characters from position 72 are to be considered as comment. A common diff --git a/doxy/Doxyfile.in b/doxy/Doxyfile.in index d7a96d6..5cad430 100644 --- a/doxy/Doxyfile.in +++ b/doxy/Doxyfile.in @@ -68,7 +68,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @PROJECT_SOURCE_DIR@/docs/ +OUTPUT_DIRECTORY = @DOXY_OUTPUT_DIR@ # If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 # sub-directories (in 2 levels) under the output directory of each output format @@ -944,7 +944,8 @@ WARN_LOGFILE = # Note: If this tag is empty the current directory is searched. INPUT = "@PROJECT_SOURCE_DIR@/include/" \ - "@PROJECT_SOURCE_DIR@/source/" + "@PROJECT_SOURCE_DIR@/source/" \ + "@PROJECT_SOURCE_DIR@/README.md" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1159,7 +1160,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = "@PROJECT_SOURCE_DIR@/README.md" # The Fortran standard specifies that for fixed formatted Fortran code all # characters from position 72 are to be considered as comment. A common diff --git a/include/fennec/core/engine.h b/include/fennec/core/engine.h index 0604738..1fc5790 100644 --- a/include/fennec/core/engine.h +++ b/include/fennec/core/engine.h @@ -29,15 +29,21 @@ /// /// -/// \mainpage fennec -/// \anchor fennec -/// -/// \include{doc} README.md +/// \page page_fennec_documentation Documentation /// +/// \section page_documentation_contents Main Page +/// 1. \ref introduction "Introduction" +/// 2. \ref introduction "Building from Source" +/// 1. \ref building-from-source "Building from Source" +/// 2. \ref building-from-terminal "Building from Terminal" +/// 3. \ref running-the-test-suite "Running the Test Suite" +/// 3. \ref usage "Usage" +/// 4. \ref contribution "Contribution" /// /// \section Libraries -/// -/// \subpage page_fennec_math +/// \anchor libraries +/// - \subpage page_fennec_lang +/// - \subpage page_fennec_math /// /// \copyright Copyright © 2025 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html)) /// diff --git a/include/fennec/lang/intrinsics.h b/include/fennec/lang/intrinsics.h index 29861ec..1c2377b 100644 --- a/include/fennec/lang/intrinsics.h +++ b/include/fennec/lang/intrinsics.h @@ -93,10 +93,10 @@ // Difficult and Inconsistent without intrinsics #if __has_builtin(__is_constructible) -# define FENNEC_HAS_BUILTIN_CAN_CONSTRUCT 1 -# define FENNEC_BUILTIN_CAN_CONSTRUCT(type, ...) __is_constructible(type, __VA_ARGS__) +# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 1 +# define FENNEC_BUILTIN_IS_CONSTRUCTIBLE(type, ...) __is_constructible(type, __VA_ARGS__) #else -# define FENNEC_HAS_BUILTIN_CAN_CONSTRUCT 0 +# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 0 #endif diff --git a/include/fennec/lang/lang.h b/include/fennec/lang/lang.h new file mode 100644 index 0000000..c9c4f6d --- /dev/null +++ b/include/fennec/lang/lang.h @@ -0,0 +1,41 @@ +// ===================================================================================================================== +// fennec, a free and open source game engine +// Copyright © 2025 Medusa Slockbower +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// ===================================================================================================================== + +/// +/// \file lang.h +/// \brief fennec C++ language library +/// +/// +/// \details +/// \author Medusa Slockbower +/// +/// \copyright Copyright © 2025 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html)) +/// +/// + +#ifndef LANG_H +#define LANG_H + +/// +/// \page page_fennec_lang C++ Language Library +/// +/// This library implements the parts of the C++ stdlib that relate to built-in types and metaprogramming. +/// +/// + +#endif //LANG_H diff --git a/include/fennec/lang/type_traits.h b/include/fennec/lang/type_traits.h index cb94f01..f7b175d 100644 --- a/include/fennec/lang/type_traits.h +++ b/include/fennec/lang/type_traits.h @@ -208,14 +208,21 @@ template using can_convert_v = typename can_convert::type; -// fennec::is_constructible ============================================================================================ +// fennec::is_constructible =============================================================================================== + +/// +/// \brief Check if `ClassT` can be constructed with `ArgsT,` i.e. `ClassT(ArgsT...)`. +/// This may be read as "is `ClassT` constructible with `ArgsT`" +/// \tparam ClassT The class type to test +/// \tparam ArgsT The arguments for the specific constructor +template struct is_constructible + : bool_constant {}; + +template constexpr bool_t is_constructible_v + = is_constructible{}; -template struct can_construct - : bool_constant {}; - -template constexpr bool_t can_construct_v - = can_construct{}; +// fennec:: // diff --git a/logo/raster.png b/logo/raster.png index 8eeedab..1fe3b60 100644 Binary files a/logo/raster.png and b/logo/raster.png differ diff --git a/logo/vector.svg b/logo/vector.svg index b77523f..0137f64 100644 --- a/logo/vector.svg +++ b/logo/vector.svg @@ -26,45 +26,128 @@ inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" inkscape:document-units="px" - inkscape:zoom="1.4142136" - inkscape:cx="313.2483" - inkscape:cy="291.68155" - inkscape:window-width="3440" - inkscape:window-height="1371" + inkscape:zoom="0.70710678" + inkscape:cx="7.0710678" + inkscape:cy="224.15285" + inkscape:window-width="1920" + inkscape:window-height="1043" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="layer1" /> + style="fill:#302825;fill-opacity:1" + d="M 135,16 C 64,16 16,64 16,135 c 0,80.66667 0,161.33333 0,242 0,71 48,119 119,119 80.66667,0 161.33333,0 242,0 71,0 119,-48 119,-119 0,-80.66667 0,-161.33333 0,-242 C 496,64 448,16 377,16 296.33333,16 215.66667,16 135,16 Z" + id="path6" + sodipodi:nodetypes="ccccccccc" />