Commit ff6f2282 authored by Florian Oetke's avatar Florian Oetke
Browse files

integrated all core_assets into the binary and fixed ZIP loading/embedding [fixes #37]

parent 0b5a3e4e
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(mirrage_ecs LANGUAGES CXX)
project(mirrage_ecs)
# need to be specified with the sources for correct syntax highlighting in some IDEs
file(GLOB_RECURSE HEADER_FILES
......
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(mirrage_error LANGUAGES CXX)
project(mirrage_error)
# need to be specified with the sources for correct syntax highlighting in some IDEs
file(GLOB_RECURSE HEADER_FILES
......
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(mirrage_graphic LANGUAGES CXX)
project(mirrage_graphic)
find_package(Vulkan REQUIRED)
......
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(mirrage_gui LANGUAGES CXX)
project(mirrage_gui)
# need to be specified with the sources for correct syntax highlighting in some IDEs
file(GLOB_RECURSE HEADER_FILES
......@@ -16,6 +16,13 @@ add_library(mirrage_gui STATIC
${HEADER_FILES}
)
add_library(mirrage::gui ALIAS mirrage_gui)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/assets_mirrage_gui.map" CONTENT
"cfg:gui = settings/gui.json
font: = fonts/
font:default_font = fonts/default_font.ttf
")
mirrage_embed_asset(mirrage_gui "${CMAKE_CURRENT_BINARY_DIR}/assets_mirrage_gui.map;${CMAKE_CURRENT_SOURCE_DIR}/assets/fonts"
"${CMAKE_CURRENT_BINARY_DIR}/assets_mirrage_gui.map")
set(MIRRAGE_DEFAULT_COMPILER_ARGS ${MIRRAGE_DEFAULT_COMPILER_ARGS})
target_compile_options(mirrage_gui PRIVATE ${MIRRAGE_DEFAULT_COMPILER_ARGS})
......
......@@ -16,6 +16,8 @@
#include <string>
extern void ref_embedded_assets_mirrage_gui();
namespace mirrage::gui {
namespace {
......@@ -28,7 +30,7 @@ namespace mirrage::gui {
};
struct Gui_cfg {
std::vector<Font_desc> fonts;
std::vector<Font_desc> fonts{{"font:default_font", 12, true}};
};
sf2_structDef(Font_desc, aid, size, default_font);
sf2_structDef(Gui_cfg, fonts);
......@@ -442,6 +444,7 @@ namespace mirrage::gui {
Gui::Gui(glm::vec4 viewport, asset::Asset_manager& assets, input::Input_manager& input)
: _viewport(viewport), _assets(assets), _input(input)
{
ref_embedded_assets_mirrage_gui();
}
Gui::~Gui() { MIRRAGE_INVARIANT(_renderer == nullptr, "GUI still has a renderer registered (leak?)"); }
......
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(mirrage_input LANGUAGES CXX)
project(mirrage_input)
find_package(SDL2 REQUIRED)
add_library(sdl2::sdl2 INTERFACE IMPORTED)
......
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(mirrage_net LANGUAGES CXX)
project(mirrage_net)
# need to be specified with the sources for correct syntax highlighting in some IDEs
file(GLOB_RECURSE HEADER_FILES
......
......@@ -14,7 +14,8 @@ file(GLOB_RECURSE ALL_SHADERS
shader/*.frag
shader/*.vert
shader/*.comp
shader/*.glsl)
shader/*.glsl
assets/assets_mirrage_renderer_shader.map)
add_custom_target(mirrage_renderer_shaders SOURCES ${ALL_SHADERS})
......@@ -69,7 +70,13 @@ add_library(mirrage_renderer STATIC
${HEADER_FILES}
)
add_library(mirrage::renderer ALIAS mirrage_renderer)
mirrage_embed_asset(mirrage_renderer "${CMAKE_CURRENT_BINARY_DIR}/shader" ${SPIRV_BINARY_FILES})
set(EMBEDDED_ASSETS
"${CMAKE_CURRENT_BINARY_DIR}/shader"
"${CMAKE_CURRENT_SOURCE_DIR}/assets/textures"
"${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_mirrage_renderer_shader.map"
"${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_mirrage_renderer_textures.map"
)
mirrage_embed_asset(mirrage_renderer "${EMBEDDED_ASSETS}" ${SPIRV_BINARY_FILES})
set(MIRRAGE_DEFAULT_COMPILER_ARGS ${MIRRAGE_DEFAULT_COMPILER_ARGS})
target_compile_options(mirrage_renderer PRIVATE ${MIRRAGE_DEFAULT_COMPILER_ARGS})
......
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(mirrage_utils LANGUAGES CXX)
project(mirrage_utils)
# need to be specified with the sources for correct syntax highlighting in some IDEs
file(GLOB_RECURSE HEADER_FILES
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment