1
0
Fork 0
mirror of https://github.com/gwm17/Specter.git synced 2024-11-22 18:28:52 -05:00
Font embedding
This commit is contained in:
Gordon McCann 2022-11-13 08:36:59 -05:00
commit 74e6c1d122
6 changed files with 91 additions and 57 deletions

View File

@ -12,9 +12,10 @@ endif()
project(SpecProject) project(SpecProject)
set(SPECPROJECT_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../bin) set(SPECPROJECT_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../bin)
set(SPECTER_CONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../lib/cmake)
#Use this to find Specter and its libraries. Specify the path to the Specter/lib dir after the PATHS keyword #Use this to find Specter and its libraries. Specify the path to the Specter/lib & Specter/lib/cmake dir after the PATHS keyword (handles windows/linux usecases)
find_package(Specter REQUIRED PATHS ../lib) find_package(Specter REQUIRED PATHS ../lib ../lib/cmake)
add_executable(SpecProject) add_executable(SpecProject)
@ -23,7 +24,7 @@ target_include_directories(SpecProject PUBLIC
) )
target_sources(SpecProject PRIVATE target_sources(SpecProject PRIVATE
./src/main.cpp ./src/SPSApp.cpp
./src/MassMap.cpp ./src/MassMap.cpp
./src/MassMap.h ./src/MassMap.h
./src/SPSAnalysisStage.cpp ./src/SPSAnalysisStage.cpp
@ -37,9 +38,17 @@ target_link_libraries(SpecProject PRIVATE Specter::Specter)
set_target_properties(SpecProject PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SPECPROJECT_BINARY_DIR}) set_target_properties(SpecProject PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SPECPROJECT_BINARY_DIR})
if(NOT EXISTS "${SPECPROJECT_BINARY_DIR}/Assets") if(NOT EXISTS "${SPECPROJECT_BINARY_DIR}/Assets")
add_custom_command(TARGET SpecProject if(MSVC)
POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink add_custom_command(TARGET SpecProject
${CMAKE_CURRENT_SOURCE_DIR}/Assets POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory
${SPECPROJECT_BINARY_DIR}/Assets ${CMAKE_CURRENT_SOURCE_DIR}/Assets
) ${SPECPROJECT_BINARY_DIR}/Assets
)
else()
add_custom_command(TARGET SpecProject
POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_CURRENT_SOURCE_DIR}/Assets
${SPECPROJECT_BINARY_DIR}/Assets
)
endif()
endif() endif()

View File

@ -0,0 +1,9 @@
(?)
[ Copy "Hello, world!" to clipboard ]
### Window options ###
### Widgets ###
### Layout & Scrolling ###
### Popups & Modal windows ###
### Tables & Columns ###
### Filtering ###
### Inputs, Navigation & Focus ###

View File

@ -0,0 +1,29 @@
/*
main.cpp
Entry point for the example SpecProject. Also contains example of a simple user Specter::Application.
GWM -- Feb 2022
*/
#include "Specter.h"
#include "SPSAnalysisStage.h"
#include "SPSInputLayer.h"
//Including this inserts the predefined main function for Specter projects
//Can only be included once per project!
#include "Specter/Core/EntryPoint.h"
//User application class. Pushes user analysis stages.
class SPSApp : public Specter::Application
{
public:
SPSApp(const Specter::ApplicationArgs& args) :
Specter::Application(args)
{
PushLayer(new Specter::SPSInputLayer(m_manager));
//PushLayer(new Navigator::TestServerLayer());
PushAnalysisStage(new Specter::SPSAnalysisStage(m_manager));
}
};
//Define the creation function to make our user application
Specter::Application* Specter::CreateApplication(const ApplicationArgs& args) { return new SPSApp(args); }

View File

@ -1,49 +0,0 @@
/*
main.cpp
Entry point for the example NavProject. Also contains example of a simple user Navigator::Application.
GWM -- Feb 2022
*/
#include "Specter.h"
#include "SPSAnalysisStage.h"
#include "SPSInputLayer.h"
#include <filesystem>
//User application class. Pushes user analysis stages.
class SPSApp : public Specter::Application
{
public:
SPSApp(const Specter::ApplicationArgs& args) :
Specter::Application(args)
{
PushLayer(new Specter::SPSInputLayer(m_manager));
//PushLayer(new Navigator::TestServerLayer());
PushAnalysisStage(new Specter::SPSAnalysisStage(m_manager));
}
};
//Define the creation function to make our user application
Specter::Application* Specter::CreateApplication(const ApplicationArgs& args) { return new SPSApp(args); }
//Make sure to initialize log BEFORE creating application.
int main(int argc, const char** argv)
{
Specter::Logger::Init();
SPEC_INFO("Logger Initialized");
Specter::ApplicationArgs args;
args.name = "SPS Specter";
args.runtimePath = std::filesystem::current_path();
SPEC_PROFILE_BEGIN_SESSION("Startup", "navprofile_startup.json");
auto app = Specter::CreateApplication(args);
SPEC_PROFILE_END_SESSION();
SPEC_PROFILE_BEGIN_SESSION("Runtime", "navprofile_runtime.json");
app->Run();
SPEC_PROFILE_END_SESSION();
SPEC_PROFILE_BEGIN_SESSION("Shutdown", "navprofile_shutdown.json");
delete app;
SPEC_PROFILE_END_SESSION();
}

View File

@ -124,6 +124,7 @@ target_sources(Specter PRIVATE
Specter/Utils/Functions.cpp Specter/Utils/Functions.cpp
Specter/Utils/RandomGenerator.h Specter/Utils/RandomGenerator.h
Specter/Utils/ThreadSafeQueue.h Specter/Utils/ThreadSafeQueue.h
Specter/Core/EntryPoint.h
) )
#ImPlot sources #ImPlot sources

View File

@ -0,0 +1,35 @@
/*
EntryPoint.h
Predefined main function for Specter-based projects. Makes it so user doesn't have to know
about initializing the Logger, Profiling sessions, etc.
*/
#ifndef ENTRY_POINT_H
#define ENTRY_POINT_H
#include "Specter/Core/Application.h"
//Make sure to initialize log BEFORE creating application.
int main(int argc, const char** argv)
{
Specter::Logger::Init();
SPEC_INFO("Logger Initialized");
Specter::ApplicationArgs args;
args.name = "Specter";
args.runtimePath = std::filesystem::current_path();
SPEC_PROFILE_BEGIN_SESSION("Startup", "navprofile_startup.json");
auto app = Specter::CreateApplication(args);
SPEC_PROFILE_END_SESSION();
SPEC_PROFILE_BEGIN_SESSION("Runtime", "navprofile_runtime.json");
app->Run();
SPEC_PROFILE_END_SESSION();
SPEC_PROFILE_BEGIN_SESSION("Shutdown", "navprofile_shutdown.json");
delete app;
SPEC_PROFILE_END_SESSION();
}
#endif