Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gamedev/fggl
  • onuralpsezer/fggl
2 results
Show changes
Showing
with 917 additions and 465 deletions
/*
* This file is part of FGGL.
*
* FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* FGGL 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with FGGL.
* If not, see <https://www.gnu.org/licenses/>.
*/
//
// Created by webpigeon on 04/09/22.
//
#ifndef FGGL_DEMO_INCLUDE_ROBOT_PROGRAMMER_HPP
#define FGGL_DEMO_INCLUDE_ROBOT_PROGRAMMER_HPP
#include <functional>
#include "fggl/gui/containers.hpp"
namespace demo::robot {
struct Instruction {
const char* name;
std::function<void(void)> m_func;
};
struct Program {
std::vector<Instruction> m_instructions;
uint32_t m_currInstruction;
bool playing = false;
inline std::size_t size() {
return m_instructions.size();
}
inline void step() {
m_instructions[ m_currInstruction ].m_func();
m_currInstruction++;
}
inline void stop() {
playing = false;
m_currInstruction = 0;
}
};
class Timeline : public fggl::gui::Panel {
public:
explicit Timeline(Program& program);
void update(float deltaTime) override;
void render(fggl::gfx::Paint& paint) override;
protected:
void renderInstructions(fggl::gfx::Paint& paint);
private:
std::vector<std::reference_wrapper<Program>> m_tracks;
};
}
#endif //FGGL_DEMO_INCLUDE_ROBOT_PROGRAMMER_HPP
/*
* ${license.title}
* Copyright (C) 2022 ${license.owner}
* ${license.mailto}
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//
// Created by webpigeon on 23/04/22.
//
#ifndef DEMO_ROLLBALL_HPP
#define DEMO_ROLLBALL_HPP
#include "fggl/scenes/game.hpp"
#include "fggl/phys/service.hpp"
#include "fggl/script/engine.hpp"
namespace demo {
enum class DebugMode {
NORMAL = 0,
DISTANCE = 1,
VISION = 2
};
struct RollState {
fggl::entity::EntityID player = fggl::entity::INVALID;
fggl::entity::EntityID closestPickup;
DebugMode mode = DebugMode::NORMAL;
std::vector<fggl::entity::EntityID> collectables;
float time = 0.0f;
};
class RollBall : public fggl::scenes::Game {
public:
explicit RollBall(fggl::App& app);
void activate() override;
void deactivate() override;
void update(float dt) override;
void render(fggl::gfx::Graphics& gfx) override;
private:
constexpr static fggl::math::vec3 HINT_COLOUR{0.5f, 0.0f, 0.0f};
RollState state;
fggl::phys::PhysicsEngine* m_phys;
fggl::script::ScriptEngine* m_scripts;
fggl::math::vec3 cameraOffset = {-15.0F, 15.0F, 0.0F};
void closestPickup(fggl::entity::EntityManager& world);
void spinCubes(fggl::entity::EntityManager& world, float dt);
};
}
#endif //DEMO_ROLLBALL_HPP
/*
* This file is part of FGGL.
*
* FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* FGGL 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with FGGL.
* If not, see <https://www.gnu.org/licenses/>.
*/
//
// Created by webpigeon on 03/07/22.
//
#ifndef DEMO_TOPDOWN_HPP
#define DEMO_TOPDOWN_HPP
#include "fggl/scenes/game.hpp"
namespace demo {
class TopDown : public fggl::scenes::Game {
public:
explicit TopDown(fggl::App& app);
void activate() override;
void update(float dt) override;
void render(fggl::gfx::Graphics& gfx) override;
private:
constexpr static fggl::math::vec3 HINT_COLOUR{0.5f, 0.0f, 0.0f};
fggl::math::vec3 cameraOffset = {-15.0F, 15.0F, 0.0F};
void pick_object();
};
}
#endif //DEMO_TOPDOWN_HPP
This diff is collapsed.
......@@ -979,7 +979,7 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
EXCLUDE_SYMBOLS = "YAML" "glm" "dd"
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
......
# headers
file(GLOB_RECURSE HEADER_LIST CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/include/fggl/**.hpp" )
file(GLOB_RECURSE HEADER_LIST CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/include/fggl/**.hpp")
# the fggl library itself
# Should be shared linkage for legal reasons (LGPL)
add_library(fggl ${HEADER_LIST})
target_link_libraries(fggl PUBLIC entt)
# we need to tell people using the library about our headers
target_include_directories( fggl
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(fggl
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
# users of this library need at least C++17
target_compile_features( fggl PUBLIC cxx_std_17 )
# users of this library need at least C++20
target_compile_features(fggl PUBLIC cxx_std_20)
# IDE support for nice header files
source_group(
TREE "${PROJECT_SOURCE_DIR}/include"
PREFIX "Header Files"
FILES ${HEADER_LIST}
TREE "${PROJECT_SOURCE_DIR}/include"
PREFIX "Header Files"
FILES ${HEADER_LIST}
)
# Generation of configuration header
......@@ -27,45 +29,62 @@ configure_file(FgglConfig.h.in FgglConfig.h)
# clang tidy
find_program(CLANG_TIDY_FOUND clang-tidy)
if ( CLANG_TIDY_FOUND )
set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=*,-llvmlibc-*,-fuchsia-*,-cppcoreguidelines-*,-android-*,-llvm-*,-altera-*,-modernize-use-trailing-return-type)
endif()
if (CLANG_TIDY_FOUND)
set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=*,-llvmlibc-*,-fuchsia-*,-cppcoreguidelines-*,-android-*,-llvm-*,-altera-*,-modernize-use-trailing-return-type)
endif ()
# the important stuff everything else uses
add_subdirectory(math)
add_subdirectory(util)
add_subdirectory(grid)
add_subdirectory(assets)
add_subdirectory(phys)
target_sources(${PROJECT_NAME}
PRIVATE
app.cpp
ecs/ecs.cpp
data/model.cpp
data/procedural.cpp
data/heightmap.cpp
ecs3/fast/Container.cpp
ecs3/prototype/world.cpp
scenes/Scene.cpp
scenes/menu.cpp
ecs3/module/module.cpp
input/camera_input.cpp
input/input.cpp
input/mouse.cpp
data/heightmap.cpp
gui/widget.cpp
gui/widgets.cpp
gui/containers.cpp
gui/fonts.cpp
math/triangulation.cpp
math/shapes.cpp
PRIVATE
app.cpp
data/model.cpp
data/procedural.cpp
data/heightmap.cpp
data/module.cpp
scenes/menu.cpp
scenes/game.cpp
input/input.cpp
input/mouse.cpp
input/camera_input.cpp
)
# spdlog for cleaner logging
find_package( spdlog )
target_link_libraries(${PROJECT_NAME} PRIVATE spdlog::spdlog)
# GUI support
add_subdirectory(gui)
find_package( freetype )
target_link_libraries(${PROJECT_NAME} PUBLIC freetype )
# yaml-cpp for configs and storage
find_package(yaml-cpp)
target_link_libraries(fggl PUBLIC yaml-cpp)
# model loading
add_subdirectory(data/assimp)
# Graphics backend
add_subdirectory(gfx)
add_subdirectory(audio)
# physics integration
# Debug backend
add_subdirectory(debug)
# platform integrations
add_subdirectory(platform)
add_subdirectory(entity)
##
# begin windows support
##
if (MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC "/ZI")
target_link_options(${PROJECT_NAME} PUBLIC "/INCREMENTAL")
endif ()
/*
* This file is part of FGGL.
*
* FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* FGGL 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with FGGL.
* If not, see <https://www.gnu.org/licenses/>.
*/
// the configured options and settings for Tutorial
#define FGGL_VERSION_MAJOR @FGGL_VERSION_MAJOR@
#define FGGL_VERSION_MINOR @FGGL_VERSION_MINOR@
This diff is collapsed.
target_sources(fggl PRIVATE
module.cpp
types.cpp
packed/module.cpp
)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
target_sources(fggl
PRIVATE
types.cpp
)
add_subdirectory(openal)
add_subdirectory(fallback)
\ No newline at end of file
target_sources(fggl
PRIVATE
audio.cpp
)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.