Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/CAE/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "Utils/PluginLoader.hpp"

#include "CAE/ArgsHandler.hpp"
#include "CAE/Engine/Engine.hpp"
#include "Engine/Engine.hpp"

namespace cae
{
Expand Down
50 changes: 2 additions & 48 deletions include/CAE/Common.hpp
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
///
/// @file Common.hpp
/// @brief This file contains
/// @brief This file contains the common definitions.
/// @namespace cae
///

#pragma once

#include <cstdint>
#include <string_view>

#ifdef _WIN32
#define APP_EXTENSION ".exe"
#else
#define APP_EXTENSION ""
#endif

#include "CAE/Generated/Version.hpp"
#include "Engine/Common.hpp"

namespace cae
{
namespace Audio
{
inline constexpr auto VOLUME = 1.F;
inline constexpr auto MUTED = false;
} // namespace Audio

namespace Message
{
static constexpr std::string_view HELP_MSG = "Usage: " PROJECT_NAME APP_EXTENSION " [options]\n\n"
Expand All @@ -35,36 +21,4 @@ namespace cae
static constexpr std::string_view VERSION_MSG = PROJECT_NAME
" v" PROJECT_VERSION " " BUILD_TYPE " (" GIT_TAG ", commit " GIT_COMMIT_HASH ") " __DATE__ " " __TIME__;
} // namespace Message

namespace Network
{
inline constexpr auto HOST = "127.0.0.1";
inline constexpr auto PORT = 4242;
} // namespace Network

namespace Plugins::Name
{
inline constexpr auto RENDERER_OPENGL = "OpenGL";
inline constexpr auto RENDERER_VULKAN = "Vulkan";
inline constexpr auto WINDOW_GLFW = "GLFW";
} // namespace Plugins::Name

namespace Renderer
{
inline constexpr auto VSYNC = false;
inline constexpr auto FRAME_RATE_LIMIT = 90;
} // namespace Renderer

namespace User
{
inline constexpr auto NAME = "User";
} // namespace User

namespace Window
{
inline constexpr uint16_t WIDTH = 1920;
inline constexpr uint16_t HEIGHT = 1080;
inline constexpr auto NAME = "CAE - Cross API Engine";
inline constexpr auto FULLSCREEN = false;
} // namespace Window
} // namespace cae
4 changes: 3 additions & 1 deletion modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
add_library(cae-modules INTERFACE)

add_subdirectory(utils)
add_subdirectory(Utils)
add_subdirectory(Engine)

target_link_libraries(cae-modules INTERFACE
utils
engine
)
target_include_directories(cae-modules SYSTEM INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/Interfaces/include"
Expand Down
38 changes: 38 additions & 0 deletions modules/Engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 4.0.0)

project(engine
VERSION 0.0.0
DESCRIPTION "Engine library"
LANGUAGES CXX
)

set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
set(INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")

file(GLOB_RECURSE SOURCES "${SRC_DIR}/*.cpp")
file(GLOB_RECURSE HEADERS "${INCLUDE_DIR}/Engine/*.hpp")

add_library(${PROJECT_NAME} STATIC)

target_sources(${PROJECT_NAME}
PRIVATE ${SOURCES}
PUBLIC FILE_SET HEADERS BASE_DIRS ${INCLUDE_DIR} FILES ${HEADERS}
)

target_link_libraries(${PROJECT_NAME} PRIVATE utils)
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>
)
target_include_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_SOURCE_DIR}/modules/Interfaces/include"
)

target_compile_options(${PROJECT_NAME} PRIVATE ${WARNING_FLAGS})
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
set_target_properties(${PROJECT_NAME} PROPERTIES
POSITION_INDEPENDENT_CODE ON
CXX_EXTENSIONS OFF
PREFIX ""
)
57 changes: 57 additions & 0 deletions modules/Engine/include/Engine/Common.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
///
/// @file Common.hpp
/// @brief This file contains
/// @namespace cae
///

#pragma once

#include <cstdint>

#ifdef _WIN32
#define APP_EXTENSION ".exe"
#else
#define APP_EXTENSION ""
#endif

namespace cae
{
namespace Audio
{
inline constexpr auto VOLUME = 1.F;
inline constexpr auto MUTED = false;
} // namespace Audio


namespace Network
{
inline constexpr auto HOST = "127.0.0.1";
inline constexpr auto PORT = 4242;
} // namespace Network

namespace Plugins::Name
{
inline constexpr auto RENDERER_OPENGL = "OpenGL";
inline constexpr auto RENDERER_VULKAN = "Vulkan";
inline constexpr auto WINDOW_GLFW = "GLFW";
} // namespace Plugins::Name

namespace Renderer
{
inline constexpr auto VSYNC = false;
inline constexpr auto FRAME_RATE_LIMIT = 90;
} // namespace Renderer

namespace User
{
inline constexpr auto NAME = "User";
} // namespace User

namespace Window
{
inline constexpr uint16_t WIDTH = 1920;
inline constexpr uint16_t HEIGHT = 1080;
inline constexpr auto NAME = "CAE - Cross API Engine";
inline constexpr auto FULLSCREEN = false;
} // namespace Window
} // namespace cae
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "Utils/Clock.hpp"

#include "CAE/Common.hpp"
#include "Engine/Common.hpp"
#include "Interfaces/IAudio.hpp"
#include "Interfaces/INetwork.hpp"
#include "Interfaces/Input/IInput.hpp"
Expand Down
3 changes: 1 addition & 2 deletions src/engine/engine.cpp → modules/Engine/src/engine.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "Engine/Engine.hpp"
#include "Utils/Logger.hpp"

#include "CAE/Engine/Engine.hpp"
#include "Utils/Utils.hpp"

#include <numeric>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions src/application.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <filesystem>

#include "CAE/Application.hpp"
#include "CAE/Common.hpp"

#include <filesystem>

static std::vector<std::shared_ptr<utl::IPlugin>> loadPlugins(const std::unique_ptr<utl::PluginLoader> &loader)
{
Expand Down
4 changes: 2 additions & 2 deletions src/argsHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <iostream>

#include "Utils/Env.hpp"

#include "CAE/ArgsHandler.hpp"
#include "CAE/Common.hpp"

#include <iostream>

cae::ArgsConfig cae::ArgsHandler::ParseArgs(const int argc, const char *const *argv)
{
ArgsConfig config;
Expand Down
4 changes: 2 additions & 2 deletions src/conf.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <fstream>

#include <nlohmann/json.hpp>

#include "CAE/Application.hpp"

#include <fstream>

namespace fs = std::filesystem;
using json = nlohmann::json;

Expand Down
Loading