fix vertex deps

This commit is contained in:
Andrey Zimin 2024-05-15 19:05:34 +03:00
parent c6ecdf8090
commit b1239697d4
58 changed files with 3 additions and 2270 deletions

View File

@ -1,7 +0,0 @@
#include "sandbox/sandbox.hpp"
auto main(int argc, char* args[]) -> int
{
decltype(auto) app = try_engine::create();
app.run();
}

View File

@ -1,6 +0,0 @@
executable(
'try_engine',
'main.cpp',
dependencies : deps,
cpp_args: args
)

View File

@ -1,4 +0,0 @@
inc += include_directories('.')
subdir('try_engine')
subdir('sandbox')

View File

@ -1,70 +0,0 @@
#include "test_panel.hpp"
namespace tr::layers
{
void test_panel::on_attach()
{
BASE_WINDOW_FLAGS();
m_win.m_pos = { 212.f, 35.f };
m_win.m_size = { 720.f, 480.f };
m_win.m_name = "test_win";
}
void test_panel::on_detach()
{
}
void test_panel::gui_render()
{
ImGui::SetNextWindowPos(m_win.m_pos);
ImGui::SetNextWindowSize(m_win.m_size);
BEGIN_IMGUI_WIN();
{
if (ImGui::Button("RUN", ImVec2(28, 30)))
{
m_event_manager->execute(std::string("test signal key"), "value params run");
}
TR_PUSH_FONT(ICON, 18);
if (ImGui::Button(try_engine::style::icon::ICON_STOP, ImVec2(28, 30)))
{
m_event_manager->execute(std::string("test signal key"), "value params stop");
m_event_manager->execute(std::string("test signal win"), m_win);
}
ImGui::Text(try_engine::style::icon::ICON_PAINT_BRUSH, " Paint" );
ImGui::Text("\xef\x87\xbc");
TR_POP_FONT();
}
END_IMGUI_WIN();
}
void test_panel::on_event(system_event& e)
{
if (e.get_name() == try_engine::system_event::classificator::KEY_PRESSED())
{
auto t = static_cast<try_engine::system_event::key_pressed_event&>(e);
if (t.get_keycode() == try_engine::key::J)
hack::log()("Ok this is J");
}
}
void test_panel::on_event(std::any e, std::any value)
{
auto b = std::any_cast<std::string>(e);
hack::log()(b);
if (b == "test signal win")
{
auto w = std::any_cast<win>(value);
hack::log()(w.m_name);
}
}
}

View File

@ -1,15 +0,0 @@
#pragma once
#include "try_engine/try_engine.hpp"
namespace tr::layers
{
class test_panel : public try_engine::layer
{
BASE_IMPL(test_panel);
private:
bool m_open = true;
};
}

View File

@ -1,23 +0,0 @@
headers = [
'sandbox.hpp',
'layers/test_panel/test_panel.hpp'
]
sources = [
'layers/test_panel/test_panel.cpp'
]
lib = library(
'sandbox',
include_directories : inc,
sources: [headers, sources],
dependencies : deps,
cpp_args: args
)
sandbox_dep = declare_dependency(
include_directories: inc,
link_with: lib,
)
deps += sandbox_dep

View File

@ -1,40 +0,0 @@
#include "layers/test_panel/test_panel.hpp"
namespace try_engine_sandbox
{
class sandbox : public try_engine::application
{
using event_manager = try_engine::app_event::event;
public:
sandbox(std::string app_name) : try_engine::application{ app_name } {};
~sandbox() = default;
public:
template<typename... Args>
void push_layer(Args... args)
{
(args->set_event_manager(&m_event_manager), ...);
try_engine::application::push_layer(args...);
}
private:
event_manager m_event_manager;
};
}
namespace try_engine
{
inline application& create()
{
static try_engine_sandbox::sandbox e{ "sandbox" };
e.push_layer(
new tr::layers::test_panel{}
);
e.attach_layers();
return e;
}
}

View File

@ -1,51 +0,0 @@
#include "application.hpp"
#include "try_engine/utils/utils.hpp"
namespace try_engine
{
application::application(std::string app_name)
{
instance = std::unique_ptr<application>(this);
m_win = std::make_unique<window>(app_name);
m_win->set_event_callback(BIND_EVENT_FN(application, on_event));
m_gui = std::make_unique<gui>();
}
void application::run()
{
while(!glfwWindowShouldClose(m_win->glfw_window()))
{
m_win->clear();
m_gui->begin_frame();
for (auto l : m_layers_stack)
l->gui_render();
m_gui->end_frame();
m_win->update();
}
}
std::unique_ptr<window>& application::get_window()
{
return m_win;
}
std::unique_ptr<application>& application::get()
{
return instance;
}
void application::attach_layers()
{
for (auto l : m_layers_stack) l->on_attach();
}
void application::on_event(system_event::event& e)
{
for(const auto l : m_layers_stack) l->on_event(e);
}
}

View File

@ -1,41 +0,0 @@
#pragma once
#include "try_engine/window/window.hpp"
#include "try_engine/gui/gui.hpp"
#include "try_engine/layer/layer.hpp"
namespace try_engine
{
class application
{
using layers_stack = std::vector<layer*>;
public:
application(std::string);
virtual ~application() = default;
private:
inline static std::unique_ptr<application> instance = nullptr;
std::unique_ptr<window> m_win;
layers_stack m_layers_stack;
std::unique_ptr<gui> m_gui;
public:
void run();
void attach_layers();
std::unique_ptr<window>& get_window();
static std::unique_ptr<application>& get();
public:
template<typename... Args>
void push_layer(Args*... args) { (m_layers_stack.push_back(args), ...); }
private:
void clear();
void on_event(system_event::event& e);
};
// реализация см. в проекте
application& create();
}

View File

@ -1,49 +0,0 @@
#pragma once
#include <oneapi/tbb/parallel_for.h>
#include "try_engine/layer/layer.hpp"
namespace try_engine::app_event
{
using layers_stack = std::vector<layer*>;
class event
{
public:
void set_event_callback(layer* l)
{
l_stack.push_back(l);
};
void execute(std::any type, std::any value)
{
for (const auto layer : l_stack)
{
std::thread th {
[=]() {
layer->on_event(type, value);
}
};
th.detach();
}
// tbb::parallel_for(tbb::blocked_range<int>(0, l_stack.size()), [&](tbb::blocked_range<int> r) {
// for (int i = r.begin(); i < r.end(); ++i)
// l_stack[i]->on_event(type, value);
// });
}
// когда нужно выполнение именно по очередности
void execute_queue(std::any type, std::any value)
{
for (const auto layer : l_stack)
layer->on_event(type, value);
}
void print_size();
private:
layers_stack l_stack;
};
}

View File

@ -1,40 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
#include "try_engine/event/system_event/event.hpp"
#include "try_engine/event/system_event/classificator.hpp"
namespace try_engine::system_event
{
class key_event : public event
{
// HERE
// ???
protected:
key_event(int kc) : m_keycode { kc } {}
protected:
int m_keycode;
public:
inline int get_keycode() const { return m_keycode; }
};
class key_pressed_event : public key_event
{
public:
key_pressed_event(int keycode) : key_event(keycode) {}
public:
EVENT_CLASS_TYPE_FN(classificator::KEY_PRESSED())
};
class key_released_event : public key_event
{
public:
key_released_event(int keycode) : key_event(keycode) {}
public:
EVENT_CLASS_TYPE_FN(classificator::KEY_RELEASED())
};
}

View File

@ -1,94 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
#include "try_engine/event/system_event/event.hpp"
#include "try_engine/event/system_event/classificator.hpp"
namespace try_engine::system_event
{
// class MouseMovedEvent : public Event
// {
// public:
// MouseMovedEvent(float x, float y) : m_MouseX(x), m_MouseY(y) {}
//
// inline float GetX() const { return m_MouseX; }
// inline float GetY() const { return m_MouseY; }
//
// std::string ToString() const override
// {
// std::stringstream ss;
// ss << "MouseMovedEvent: " << m_MouseX << ", " << m_MouseY;
// return ss.str();
// }
//
// EVENT_CLASS_TYPE(MouseMoved)
// EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)
//
// private:
// float m_MouseX, m_MouseY;
// };
//
// class MouseScrolledEvent : public Event
// {
// public:
// MouseScrolledEvent(float xOffset, float yOffset) : m_XOffset(xOffset), m_YOffset(yOffset) {}
//
// inline float GetXOffset() const { return m_XOffset; }
// inline float GetYOffset() const { return m_YOffset; }
//
// std::string ToString() const override
// {
// std::stringstream ss;
// ss << "MouseScrolledEvent: " << GetXOffset() << ", " << GetYOffset();
// return ss.str();
// }
//
// EVENT_CLASS_TYPE(MouseScrolled)
// EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)
//
// private:
// float m_XOffset, m_YOffset;
// };
// class MouseButtonEvent : public Event
// {
// public:
// inline int GetMouseButton() const { return m_Button; }
// EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)
//
// protected:
// MouseButtonEvent(int button) : m_Button(button) {}
// int m_Button;
// };
//
// class MouseButtonPressedEvent : public MouseButtonEvent
// {
// public:
// MouseButtonPressedEvent(int button) : MouseButtonEvent(button) {}
//
// std::string ToString() const override
// {
// std::stringstream ss;
// ss << "MouseButtonPressedEvent: " << m_Button;
// return ss.str();
// }
//
// EVENT_CLASS_TYPE(MouseButtonPressed)
// };
//
// class MouseButtonReleasedEvent : public MouseButtonEvent
// {
// public:
// MouseButtonReleasedEvent(int button) : MouseButtonEvent(button) {}
//
// std::string ToString() const override
// {
// std::stringstream ss;
// ss << "MouseButtonReleasedEvent: " << m_Button;
// return ss.str();
// }
//
// EVENT_CLASS_TYPE(MouseButtonReleased)
// };
}

View File

@ -1,49 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
#include "try_engine/event/system_event/event.hpp"
#include "try_engine/event/system_event/classificator.hpp"
namespace try_engine::system_event
{
class window_resize_event : public event
{
public:
window_resize_event(int w, int h) : m_width { w }, m_height { h } {}
private:
int m_width, m_height;
public:
EVENT_CLASS_TYPE_FN(classificator::WINDOW_RESIZE())
public:
inline unsigned int get_width() const { return m_width; }
inline unsigned int get_height() const { return m_height; }
};
class window_close_event : public event
{
public:
window_close_event() = default;
public:
EVENT_CLASS_TYPE_FN(classificator::WINDOW_CLOSE())
};
class window_focus_event : public event
{
public:
window_focus_event(int f) : m_focused { f } {}
private:
int m_focused;
public:
EVENT_CLASS_TYPE_FN(classificator::WINDOW_FOCUS())
public:
inline int get_focused() { return m_focused; }
};
}

View File

@ -1,13 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
namespace try_engine::system_event::classificator
{
inline std::string WINDOW_RESIZE() { return "WINDOW_RESIZE"; }
inline std::string WINDOW_CLOSE() { return "WINDOW_CLOSE"; }
inline std::string WINDOW_FOCUS() { return "WINDOW_FOCUS"; }
inline std::string KEY_PRESSED() { return "KEY_PRESSED"; }
inline std::string KEY_RELEASED() { return "KEY_RELEASED"; }
}

View File

@ -1,13 +0,0 @@
#pragma once
#include "hack/utils/utils.hpp"
namespace try_engine::system_event
{
struct event
{
event() = default;
virtual ~event() = default;
virtual std::string get_name() const = 0;
};
}

View File

@ -1,62 +0,0 @@
#include "gui.hpp"
#include "style/style.hpp"
#include "try_engine/application/application.hpp"
namespace try_engine
{
gui::gui()
{
// HERE
// откуда она ???
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGui::StyleColorsDark();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
io.IniFilename = nullptr;
ImGuiStyle& style = ImGui::GetStyle();
if (io.ConfigFlags)
{
style.WindowRounding = 0.0f;
style.Colors[ImGuiCol_WindowBg].w = 1.0f;
}
auto& app = application::get();
GLFWwindow* window = app->get_window()->glfw_window();
ImGui_ImplGlfw_InitForOpenGL(window, true);
ImGui_ImplOpenGL3_Init("#version 410");
style::init();
}
gui::~gui()
{
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
}
void gui::begin_frame()
{
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
}
void gui::end_frame()
{
ImGuiIO& io = ImGui::GetIO();
auto& app = application::get();
io.DisplaySize = ImVec2((float)app->get_window()->width(), (float)app->get_window()->height());
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
}
}

View File

@ -1,19 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
namespace try_engine
{
struct win { ImVec2 m_pos { 0.f, 0.f }; ImVec2 m_size { 0.f, 0.f }; std::string m_name; };
class gui
{
public:
gui();
~gui();
public:
void begin_frame();
void end_frame();
};
}

View File

@ -1,103 +0,0 @@
#pragma once
#include <string>
#include <vector>
#include <map>
#include "imgui.h"
#include "icons.hpp"
namespace try_engine::style::fonts
{
inline std::string font_name = "Montserrat/Montserrat-";
inline std::vector<float> font_size = { 8.f, 9.f, 10.f, 11.f, 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f, 19.f, 20.f, 21.f, 22.f };
enum font_type
{
BOLD, BOLD_ITALIC, EXTRA_BOLD, EXTRA_BOLD_ITALIC, EXTRA_LIGHT, EXTRA_LIGHT_ITALIC,
ITALIC, LIGHT, LIGHT_ITALIC, MEDIUM, MEDIUM_ITALIC, REGULAR, SEMI_BOLD, SEMI_BOLD_ITALIC, THIN, THIN_ITALIC, ICON
};
// HERE
// эту порнографию с путями нужно решить
inline const std::string ICONS_PATH = "/mnt/raid/projects/cpp/try_engine/src/try_engine/internal/fonts/FontAwesome/forkawesome-webfont.ttf";
inline const std::string FONT_PATH = "/mnt/raid/projects/cpp/try_engine/src/try_engine/internal/fonts/";
inline std::vector<std::string> fonts_path
{
FONT_PATH + font_name + "Bold.ttf",
FONT_PATH + font_name + "BoldItalic.ttf",
FONT_PATH + font_name + "ExtraBold.ttf",
FONT_PATH + font_name + "ExtraBoldItalic.ttf",
FONT_PATH + font_name + "ExtraLight.ttf",
FONT_PATH + font_name + "ExtraLightItalic.ttf",
FONT_PATH + font_name + "Italic.ttf",
FONT_PATH + font_name + "Light.ttf",
FONT_PATH + font_name + "LightItalic.ttf",
FONT_PATH + font_name + "Medium.ttf",
FONT_PATH + font_name + "MediumItalic.ttf",
FONT_PATH + font_name + "Regular.ttf",
FONT_PATH + font_name + "SemiBold.ttf",
FONT_PATH + font_name + "SemiBoldItalic.ttf",
FONT_PATH + font_name + "Thin.ttf",
FONT_PATH + font_name + "ThinItalic.ttf"
};
inline std::map<font_type, int> font_step
{
{ font_type::BOLD, 0 },
{ font_type::BOLD_ITALIC, 15 },
{ font_type::EXTRA_BOLD, 30 },
{ font_type::EXTRA_BOLD_ITALIC, 45 },
{ font_type::EXTRA_LIGHT, 60 },
{ font_type::EXTRA_LIGHT_ITALIC, 75 },
{ font_type::ITALIC, 90 },
{ font_type::LIGHT, 105 },
{ font_type::LIGHT_ITALIC, 120 },
{ font_type::MEDIUM, 135 },
{ font_type::MEDIUM_ITALIC, 150 },
{ font_type::REGULAR, 165 },
{ font_type::SEMI_BOLD, 180 },
{ font_type::SEMI_BOLD_ITALIC, 195 },
{ font_type::THIN, 210 },
{ font_type::THIN_ITALIC, 225 },
{ font_type::ICON, 240 },
};
inline void init()
{
ImGuiIO& io = ImGui::GetIO();
for (auto& p : fonts_path)
for (auto size : font_size)
io.Fonts->AddFontFromFileTTF(p.c_str(), size, NULL, io.Fonts->GetGlyphRangesCyrillic());
// add icon font size
static const ImWchar icon_ranges[] = { ICON_MIN_FK, ICON_MAX_FK, 0 };
for (auto size : font_size)
io.Fonts->AddFontFromFileTTF(ICONS_PATH.c_str(), size, NULL, icon_ranges);
};
inline ImFont* get_font(font_type type = font_type::REGULAR, int size = 16)
{
if (size < 0) size = 8;
if (size > 33) size = 33;
size -= 8; // т.к. font_size начинается с 8.f
ImGuiIO& io = ImGui::GetIO();
ImFontAtlas* atlas = io.Fonts;
auto pos = font_step[type] + size;
return atlas->Fonts[pos];
};
}

View File

@ -1,719 +0,0 @@
#pragma once
// for use with https://github.com/ForkAwesome/Fork-Awesome/blob/master/fonts/forkawesome-webfont.ttf
#define ICON_MIN_FK 0xf000
#define ICON_MAX_FK 0xf307
namespace try_engine::style::icon
{
inline const char* ICON_GLASS = "\uf000";
inline const char* ICON_MUSIC = "\uf001";
inline const char* ICON_SEARCH = "\uf002";
inline const char* ICON_ENVELOPE_O = "\uf003";
inline const char* ICON_HEART = "\uf004";
inline const char* ICON_STAR = "\uf005";
inline const char* ICON_STAR_O = "\uf006";
inline const char* ICON_USER = "\uf007";
inline const char* ICON_FILM = "\uf008";
inline const char* ICON_TH_LARGE = "\uf009";
inline const char* ICON_TH = "\uf00a";
inline const char* ICON_TH_LIST = "\uf00b";
inline const char* ICON_CHECK = "\uf00c";
inline const char* ICON_TIMES = "\uf00d";
inline const char* ICON_SEARCH_PLUS = "\uf00e";
inline const char* ICON_SEARCH_MINUS = "\uf010";
inline const char* ICON_POWER_OFF = "\uf011";
inline const char* ICON_SIGNAL = "\uf012";
inline const char* ICON_COG = "\uf013";
inline const char* ICON_TRASH_O = "\uf014";
inline const char* ICON_HOME = "\uf015";
inline const char* ICON_FILE_O = "\uf016";
inline const char* ICON_CLOCK_O = "\uf017";
inline const char* ICON_ROAD = "\uf018";
inline const char* ICON_DOWNLOAD = "\uf019";
inline const char* ICON_ARROW_CIRCLE_O_DOWN = "\uf01a";
inline const char* ICON_ARROW_CIRCLE_O_UP = "\uf01b";
inline const char* ICON_INBOX = "\uf01c";
inline const char* ICON_PLAY_CIRCLE_O = "\uf01d";
inline const char* ICON_REPEAT = "\uf01e";
inline const char* ICON_REFRESH = "\uf021";
inline const char* ICON_LIST_ALT = "\uf022";
inline const char* ICON_LOCK = "\uf023";
inline const char* ICON_FLAG = "\uf024";
inline const char* ICON_HEADPHONES = "\uf025";
inline const char* ICON_VOLUME_OFF = "\uf026";
inline const char* ICON_VOLUME_DOWN = "\uf027";
inline const char* ICON_VOLUME_UP = "\uf028";
inline const char* ICON_QRCODE = "\uf029";
inline const char* ICON_BARCODE = "\uf02a";
inline const char* ICON_TAG = "\uf02b";
inline const char* ICON_TAGS = "\uf02c";
inline const char* ICON_BOOK = "\uf02d";
inline const char* ICON_BOOKMARK = "\uf02e";
inline const char* ICON_PRINT = "\uf02f";
inline const char* ICON_CAMERA = "\uf030";
inline const char* ICON_FONT = "\uf031";
inline const char* ICON_BOLD = "\uf032";
inline const char* ICON_ITALIC = "\uf033";
inline const char* ICON_TEXT_HEIGHT = "\uf034";
inline const char* ICON_TEXT_WIDTH = "\uf035";
inline const char* ICON_ALIGN_LEFT = "\uf036";
inline const char* ICON_ALIGN_CENTER = "\uf037";
inline const char* ICON_ALIGN_RIGHT = "\uf038";
inline const char* ICON_ALIGN_JUSTIFY = "\uf039";
inline const char* ICON_LIST = "\uf03a";
inline const char* ICON_OUTDENT = "\uf03b";
inline const char* ICON_INDENT = "\uf03c";
inline const char* ICON_VIDEO_CAMERA = "\uf03d";
inline const char* ICON_PICTURE_O = "\uf03e";
inline const char* ICON_PENCIL = "\uf040";
inline const char* ICON_MAP_MARKER = "\uf041";
inline const char* ICON_ADJUST = "\uf042";
inline const char* ICON_TINT = "\uf043";
inline const char* ICON_PENCIL_SQUARE_O = "\uf044";
inline const char* ICON_SHARE_SQUARE_O = "\uf045";
inline const char* ICON_CHECK_SQUARE_O = "\uf046";
inline const char* ICON_ARROWS = "\uf047";
inline const char* ICON_STEP_BACKWARD = "\uf048";
inline const char* ICON_FAST_BACKWARD = "\uf049";
inline const char* ICON_BACKWARD = "\uf04a";
inline const char* ICON_PLAY = "\uf04b";
inline const char* ICON_PAUSE = "\uf04c";
inline const char* ICON_STOP = "\uf04d";
inline const char* ICON_FORWARD = "\uf04e";
inline const char* ICON_FAST_FORWARD = "\uf050";
inline const char* ICON_STEP_FORWARD = "\uf051";
inline const char* ICON_EJECT = "\uf052";
inline const char* ICON_CHEVRON_LEFT = "\uf053";
inline const char* ICON_CHEVRON_RIGHT = "\uf054";
inline const char* ICON_PLUS_CIRCLE = "\uf055";
inline const char* ICON_MINUS_CIRCLE = "\uf056";
inline const char* ICON_TIMES_CIRCLE = "\uf057";
inline const char* ICON_CHECK_CIRCLE = "\uf058";
inline const char* ICON_QUESTION_CIRCLE = "\uf059";
inline const char* ICON_INFO_CIRCLE = "\uf05a";
inline const char* ICON_CROSSHAIRS = "\uf05b";
inline const char* ICON_TIMES_CIRCLE_O = "\uf05c";
inline const char* ICON_CHECK_CIRCLE_O = "\uf05d";
inline const char* ICON_BAN = "\uf05e";
inline const char* ICON_ARROW_LEFT = "\uf060";
inline const char* ICON_ARROW_RIGHT = "\uf061";
inline const char* ICON_ARROW_UP = "\uf062";
inline const char* ICON_ARROW_DOWN = "\uf063";
inline const char* ICON_SHARE = "\uf064";
inline const char* ICON_EXPAND = "\uf065";
inline const char* ICON_COMPRESS = "\uf066";
inline const char* ICON_PLUS = "\uf067";
inline const char* ICON_MINUS = "\uf068";
inline const char* ICON_ASTERISK = "\uf069";
inline const char* ICON_EXCLAMATION_CIRCLE = "\uf06a";
inline const char* ICON_GIFT = "\uf06b";
inline const char* ICON_LEAF = "\uf06c";
inline const char* ICON_FIRE = "\uf06d";
inline const char* ICON_EYE = "\uf06e";
inline const char* ICON_EYE_SLASH = "\uf070";
inline const char* ICON_EXCLAMATION_TRIANGLE = "\uf071";
inline const char* ICON_PLANE = "\uf072";
inline const char* ICON_CALENDAR = "\uf073";
inline const char* ICON_RANDOM = "\uf074";
inline const char* ICON_COMMENT = "\uf075";
inline const char* ICON_MAGNET = "\uf076";
inline const char* ICON_CHEVRON_UP = "\uf077";
inline const char* ICON_CHEVRON_DOWN = "\uf078";
inline const char* ICON_RETWEET = "\uf079";
inline const char* ICON_SHOPPING_CART = "\uf07a";
inline const char* ICON_FOLDER = "\uf07b";
inline const char* ICON_FOLDER_OPEN = "\uf07c";
inline const char* ICON_ARROWS_V = "\uf07d";
inline const char* ICON_ARROWS_H = "\uf07e";
inline const char* ICON_BAR_CHART = "\uf080";
inline const char* ICON_TWITTER_SQUARE = "\uf081";
inline const char* ICON_FACEBOOK_SQUARE = "\uf082";
inline const char* ICON_CAMERA_RETRO = "\uf083";
inline const char* ICON_KEY = "\uf084";
inline const char* ICON_COGS = "\uf085";
inline const char* ICON_COMMENTS = "\uf086";
inline const char* ICON_THUMBS_O_UP = "\uf087";
inline const char* ICON_THUMBS_O_DOWN = "\uf088";
inline const char* ICON_STAR_HALF = "\uf089";
inline const char* ICON_HEART_O = "\uf08a";
inline const char* ICON_SIGN_OUT = "\uf08b";
inline const char* ICON_LINKEDIN_SQUARE = "\uf08c";
inline const char* ICON_THUMB_TACK = "\uf08d";
inline const char* ICON_INLINEAL_LINK = "\uf08e";
inline const char* ICON_SIGN_IN = "\uf090";
inline const char* ICON_TROPHY = "\uf091";
inline const char* ICON_GITHUB_SQUARE = "\uf092";
inline const char* ICON_UPLOAD = "\uf093";
inline const char* ICON_LEMON_O = "\uf094";
inline const char* ICON_PHONE = "\uf095";
inline const char* ICON_SQUARE_O = "\uf096";
inline const char* ICON_BOOKMARK_O = "\uf097";
inline const char* ICON_PHONE_SQUARE = "\uf098";
inline const char* ICON_TWITTER = "\uf099";
inline const char* ICON_FACEBOOK = "\uf09a";
inline const char* ICON_GITHUB = "\uf09b";
inline const char* ICON_UNLOCK = "\uf09c";
inline const char* ICON_CREDIT_CARD = "\uf09d";
inline const char* ICON_RSS = "\uf09e";
inline const char* ICON_HDD_O = "\uf0a0";
inline const char* ICON_BULLHORN = "\uf0a1";
inline const char* ICON_BELL = "\uf0f3";
inline const char* ICON_CERTIFICATE = "\uf0a3";
inline const char* ICON_HAND_O_RIGHT = "\uf0a4";
inline const char* ICON_HAND_O_LEFT = "\uf0a5";
inline const char* ICON_HAND_O_UP = "\uf0a6";
inline const char* ICON_HAND_O_DOWN = "\uf0a7";
inline const char* ICON_ARROW_CIRCLE_LEFT = "\uf0a8";
inline const char* ICON_ARROW_CIRCLE_RIGHT = "\uf0a9";
inline const char* ICON_ARROW_CIRCLE_UP = "\uf0aa";
inline const char* ICON_ARROW_CIRCLE_DOWN = "\uf0ab";
inline const char* ICON_GLOBE = "\uf0ac";
inline const char* ICON_GLOBE_E = "\uf304";
inline const char* ICON_GLOBE_W = "\uf305";
inline const char* ICON_WRENCH = "\uf0ad";
inline const char* ICON_TASKS = "\uf0ae";
inline const char* ICON_FILTER = "\uf0b0";
inline const char* ICON_BRIEFCASE = "\uf0b1";
inline const char* ICON_ARROWS_ALT = "\uf0b2";
inline const char* ICON_USERS = "\uf0c0";
inline const char* ICON_LINK = "\uf0c1";
inline const char* ICON_CLOUD = "\uf0c2";
inline const char* ICON_FLASK = "\uf0c3";
inline const char* ICON_SCISSORS = "\uf0c4";
inline const char* ICON_FILES_O = "\uf0c5";
inline const char* ICON_PAPERCLIP = "\uf0c6";
inline const char* ICON_FLOPPY_O = "\uf0c7";
inline const char* ICON_SQUARE = "\uf0c8";
inline const char* ICON_BARS = "\uf0c9";
inline const char* ICON_LIST_UL = "\uf0ca";
inline const char* ICON_LIST_OL = "\uf0cb";
inline const char* ICON_STRIKETHROUGH = "\uf0cc";
inline const char* ICON_UNDERLINE = "\uf0cd";
inline const char* ICON_TABLE = "\uf0ce";
inline const char* ICON_MAGIC = "\uf0d0";
inline const char* ICON_TRUCK = "\uf0d1";
inline const char* ICON_PINTEREST = "\uf0d2";
inline const char* ICON_PINTEREST_SQUARE = "\uf0d3";
inline const char* ICON_GOOGLE_PLUS_SQUARE = "\uf0d4";
inline const char* ICON_GOOGLE_PLUS = "\uf0d5";
inline const char* ICON_MONEY = "\uf0d6";
inline const char* ICON_CARET_DOWN = "\uf0d7";
inline const char* ICON_CARET_UP = "\uf0d8";
inline const char* ICON_CARET_LEFT = "\uf0d9";
inline const char* ICON_CARET_RIGHT = "\uf0da";
inline const char* ICON_COLUMNS = "\uf0db";
inline const char* ICON_SORT = "\uf0dc";
inline const char* ICON_SORT_DESC = "\uf0dd";
inline const char* ICON_SORT_ASC = "\uf0de";
inline const char* ICON_ENVELOPE = "\uf0e0";
inline const char* ICON_LINKEDIN = "\uf0e1";
inline const char* ICON_UNDO = "\uf0e2";
inline const char* ICON_GAVEL = "\uf0e3";
inline const char* ICON_TACHOMETER = "\uf0e4";
inline const char* ICON_COMMENT_O = "\uf0e5";
inline const char* ICON_COMMENTS_O = "\uf0e6";
inline const char* ICON_BOLT = "\uf0e7";
inline const char* ICON_SITEMAP = "\uf0e8";
inline const char* ICON_UMBRELLA = "\uf0e9";
inline const char* ICON_CLIPBOARD = "\uf0ea";
inline const char* ICON_LIGHTBULB_O = "\uf0eb";
inline const char* ICON_EXCHANGE = "\uf0ec";
inline const char* ICON_CLOUD_DOWNLOAD = "\uf0ed";
inline const char* ICON_CLOUD_UPLOAD = "\uf0ee";
inline const char* ICON_USER_MD = "\uf0f0";
inline const char* ICON_STETHOSCOPE = "\uf0f1";
inline const char* ICON_SUITCASE = "\uf0f2";
inline const char* ICON_BELL_O = "\uf0a2";
inline const char* ICON_COFFEE = "\uf0f4";
inline const char* ICON_CUTLERY = "\uf0f5";
inline const char* ICON_FILE_TEXT_O = "\uf0f6";
inline const char* ICON_BUILDING_O = "\uf0f7";
inline const char* ICON_HOSPITAL_O = "\uf0f8";
inline const char* ICON_AMBULANCE = "\uf0f9";
inline const char* ICON_MEDKIT = "\uf0fa";
inline const char* ICON_FIGHTER_JET = "\uf0fb";
inline const char* ICON_BEER = "\uf0fc";
inline const char* ICON_H_SQUARE = "\uf0fd";
inline const char* ICON_PLUS_SQUARE = "\uf0fe";
inline const char* ICON_ANGLE_DOUBLE_LEFT = "\uf100";
inline const char* ICON_ANGLE_DOUBLE_RIGHT = "\uf101";
inline const char* ICON_ANGLE_DOUBLE_UP = "\uf102";
inline const char* ICON_ANGLE_DOUBLE_DOWN = "\uf103";
inline const char* ICON_ANGLE_LEFT = "\uf104";
inline const char* ICON_ANGLE_RIGHT = "\uf105";
inline const char* ICON_ANGLE_UP = "\uf106";
inline const char* ICON_ANGLE_DOWN = "\uf107";
inline const char* ICON_DESKTOP = "\uf108";
inline const char* ICON_LAPTOP = "\uf109";
inline const char* ICON_TABLET = "\uf10a";
inline const char* ICON_MOBILE = "\uf10b";
inline const char* ICON_CIRCLE_O = "\uf10c";
inline const char* ICON_QUOTE_LEFT = "\uf10d";
inline const char* ICON_QUOTE_RIGHT = "\uf10e";
inline const char* ICON_SPINNER = "\uf110";
inline const char* ICON_CIRCLE = "\uf111";
inline const char* ICON_REPLY = "\uf112";
inline const char* ICON_GITHUB_ALT = "\uf113";
inline const char* ICON_FOLDER_O = "\uf114";
inline const char* ICON_FOLDER_OPEN_O = "\uf115";
inline const char* ICON_SMILE_O = "\uf118";
inline const char* ICON_FROWN_O = "\uf119";
inline const char* ICON_MEH_O = "\uf11a";
inline const char* ICON_GAMEPAD = "\uf11b";
inline const char* ICON_KEYBOARD_O = "\uf11c";
inline const char* ICON_FLAG_O = "\uf11d";
inline const char* ICON_FLAG_CHECKERED = "\uf11e";
inline const char* ICON_TERMINAL = "\uf120";
inline const char* ICON_CODE = "\uf121";
inline const char* ICON_REPLY_ALL = "\uf122";
inline const char* ICON_STAR_HALF_O = "\uf123";
inline const char* ICON_LOCATION_ARROW = "\uf124";
inline const char* ICON_CROP = "\uf125";
inline const char* ICON_CODE_FORK = "\uf126";
inline const char* ICON_CHAIN_BROKEN = "\uf127";
inline const char* ICON_QUESTION = "\uf128";
inline const char* ICON_INFO = "\uf129";
inline const char* ICON_EXCLAMATION = "\uf12a";
inline const char* ICON_SUPERSCRIPT = "\uf12b";
inline const char* ICON_SUBSCRIPT = "\uf12c";
inline const char* ICON_ERASER = "\uf12d";
inline const char* ICON_PUZZLE_PIECE = "\uf12e";
inline const char* ICON_MICROPHONE = "\uf130";
inline const char* ICON_MICROPHONE_SLASH = "\uf131";
inline const char* ICON_SHIELD = "\uf132";
inline const char* ICON_CALENDAR_O = "\uf133";
inline const char* ICON_FIRE_EXTINGUISHER = "\uf134";
inline const char* ICON_ROCKET = "\uf135";
inline const char* ICON_MAXCDN = "\uf136";
inline const char* ICON_CHEVRON_CIRCLE_LEFT = "\uf137";
inline const char* ICON_CHEVRON_CIRCLE_RIGHT = "\uf138";
inline const char* ICON_CHEVRON_CIRCLE_UP = "\uf139";
inline const char* ICON_CHEVRON_CIRCLE_DOWN = "\uf13a";
inline const char* ICON_HTML5 = "\uf13b";
inline const char* ICON_CSS3 = "\uf13c";
inline const char* ICON_ANCHOR = "\uf13d";
inline const char* ICON_UNLOCK_ALT = "\uf13e";
inline const char* ICON_BULLSEYE = "\uf140";
inline const char* ICON_ELLIPSIS_H = "\uf141";
inline const char* ICON_ELLIPSIS_V = "\uf142";
inline const char* ICON_RSS_SQUARE = "\uf143";
inline const char* ICON_PLAY_CIRCLE = "\uf144";
inline const char* ICON_TICKET = "\uf145";
inline const char* ICON_MINUS_SQUARE = "\uf146";
inline const char* ICON_MINUS_SQUARE_O = "\uf147";
inline const char* ICON_LEVEL_UP = "\uf148";
inline const char* ICON_LEVEL_DOWN = "\uf149";
inline const char* ICON_CHECK_SQUARE = "\uf14a";
inline const char* ICON_PENCIL_SQUARE = "\uf14b";
inline const char* ICON_inlineAL_LINK_SQUARE = "\uf14c";
inline const char* ICON_SHARE_SQUARE = "\uf14d";
inline const char* ICON_COMPASS = "\uf14e";
inline const char* ICON_CARET_SQUARE_O_DOWN = "\uf150";
inline const char* ICON_CARET_SQUARE_O_UP = "\uf151";
inline const char* ICON_CARET_SQUARE_O_RIGHT = "\uf152";
inline const char* ICON_EUR = "\uf153";
inline const char* ICON_GBP = "\uf154";
inline const char* ICON_USD = "\uf155";
inline const char* ICON_INR = "\uf156";
inline const char* ICON_JPY = "\uf157";
inline const char* ICON_RUB = "\uf158";
inline const char* ICON_KRW = "\uf159";
inline const char* ICON_BTC = "\uf15a";
inline const char* ICON_FILE = "\uf15b";
inline const char* ICON_FILE_TEXT = "\uf15c";
inline const char* ICON_SORT_ALPHA_ASC = "\uf15d";
inline const char* ICON_SORT_ALPHA_DESC = "\uf15e";
inline const char* ICON_SORT_AMOUNT_ASC = "\uf160";
inline const char* ICON_SORT_AMOUNT_DESC = "\uf161";
inline const char* ICON_SORT_NUMERIC_ASC = "\uf162";
inline const char* ICON_SORT_NUMERIC_DESC = "\uf163";
inline const char* ICON_THUMBS_UP = "\uf164";
inline const char* ICON_THUMBS_DOWN = "\uf165";
inline const char* ICON_YOUTUBE_SQUARE = "\uf166";
inline const char* ICON_YOUTUBE = "\uf167";
inline const char* ICON_XING = "\uf168";
inline const char* ICON_XING_SQUARE = "\uf169";
inline const char* ICON_YOUTUBE_PLAY = "\uf16a";
inline const char* ICON_DROPBOX = "\uf16b";
inline const char* ICON_STACK_OVERFLOW = "\uf16c";
inline const char* ICON_INSTAGRAM = "\uf16d";
inline const char* ICON_FLICKR = "\uf16e";
inline const char* ICON_ADN = "\uf170";
inline const char* ICON_BITBUCKET = "\uf171";
inline const char* ICON_BITBUCKET_SQUARE = "\uf172";
inline const char* ICON_TUMBLR = "\uf173";
inline const char* ICON_TUMBLR_SQUARE = "\uf174";
inline const char* ICON_LONG_ARROW_DOWN = "\uf175";
inline const char* ICON_LONG_ARROW_UP = "\uf176";
inline const char* ICON_LONG_ARROW_LEFT = "\uf177";
inline const char* ICON_LONG_ARROW_RIGHT = "\uf178";
inline const char* ICON_APPLE = "\uf179";
inline const char* ICON_PROJECTS = "\uf17a";
inline const char* ICON_ANDROID = "\uf17b";
inline const char* ICON_LINUX = "\uf17c";
inline const char* ICON_DRIBBBLE = "\uf17d";
inline const char* ICON_SKYPE = "\uf17e";
inline const char* ICON_FOURSQUARE = "\uf180";
inline const char* ICON_TRELLO = "\uf181";
inline const char* ICON_FEMALE = "\uf182";
inline const char* ICON_MALE = "\uf183";
inline const char* ICON_GRATIPAY = "\uf184";
inline const char* ICON_SUN_O = "\uf185";
inline const char* ICON_MOON_O = "\uf186";
inline const char* ICON_ARCHIVE = "\uf187";
inline const char* ICON_BUG = "\uf188";
inline const char* ICON_VK = "\uf189";
inline const char* ICON_WEIBO = "\uf18a";
inline const char* ICON_RENREN = "\uf18b";
inline const char* ICON_PAGELINES = "\uf18c";
inline const char* ICON_STACK_EXCHANGE = "\uf18d";
inline const char* ICON_ARROW_CIRCLE_O_RIGHT = "\uf18e";
inline const char* ICON_ARROW_CIRCLE_O_LEFT = "\uf190";
inline const char* ICON_CARET_SQUARE_O_LEFT = "\uf191";
inline const char* ICON_DOT_CIRCLE_O = "\uf192";
inline const char* ICON_WHEELCHAIR = "\uf193";
inline const char* ICON_VIMEO_SQUARE = "\uf194";
inline const char* ICON_TRY = "\uf195";
inline const char* ICON_PLUS_SQUARE_O = "\uf196";
inline const char* ICON_SPACE_SHUTTLE = "\uf197";
inline const char* ICON_SLACK = "\uf198";
inline const char* ICON_ENVELOPE_SQUARE = "\uf199";
inline const char* ICON_WORDPRESS = "\uf19a";
inline const char* ICON_OPENID = "\uf19b";
inline const char* ICON_UNIVERSITY = "\uf19c";
inline const char* ICON_GRADUATION_CAP = "\uf19d";
inline const char* ICON_YAHOO = "\uf19e";
inline const char* ICON_GOOGLE = "\uf1a0";
inline const char* ICON_REDDIT = "\uf1a1";
inline const char* ICON_REDDIT_SQUARE = "\uf1a2";
inline const char* ICON_STUMBLEUPON_CIRCLE = "\uf1a3";
inline const char* ICON_STUMBLEUPON = "\uf1a4";
inline const char* ICON_DELICIOUS = "\uf1a5";
inline const char* ICON_DIGG = "\uf1a6";
inline const char* ICON_DRUPAL = "\uf1a9";
inline const char* ICON_JOOMLA = "\uf1aa";
inline const char* ICON_LANGUAGE = "\uf1ab";
inline const char* ICON_FAX = "\uf1ac";
inline const char* ICON_BUILDING = "\uf1ad";
inline const char* ICON_CHILD = "\uf1ae";
inline const char* ICON_PAW = "\uf1b0";
inline const char* ICON_SPOON = "\uf1b1";
inline const char* ICON_CUBE = "\uf1b2";
inline const char* ICON_CUBES = "\uf1b3";
inline const char* ICON_BEHANCE = "\uf1b4";
inline const char* ICON_BEHANCE_SQUARE = "\uf1b5";
inline const char* ICON_STEAM = "\uf1b6";
inline const char* ICON_STEAM_SQUARE = "\uf1b7";
inline const char* ICON_RECYCLE = "\uf1b8";
inline const char* ICON_CAR = "\uf1b9";
inline const char* ICON_TAXI = "\uf1ba";
inline const char* ICON_TREE = "\uf1bb";
inline const char* ICON_SPOTIFY = "\uf1bc";
inline const char* ICON_DEVIANTART = "\uf1bd";
inline const char* ICON_SOUNDCLOUD = "\uf1be";
inline const char* ICON_DATABASE = "\uf1c0";
inline const char* ICON_FILE_PDF_O = "\uf1c1";
inline const char* ICON_FILE_WORD_O = "\uf1c2";
inline const char* ICON_FILE_EXCEL_O = "\uf1c3";
inline const char* ICON_FILE_POWERPOINT_O = "\uf1c4";
inline const char* ICON_SAVE = "\uf0c7";
inline const char* ICON_FILE_IMAGE_O = "\uf1c5";
inline const char* ICON_FILE_ARCHIVE_O = "\uf1c6";
inline const char* ICON_FILE_AUDIO_O = "\uf1c7";
inline const char* ICON_FILE_VIDEO_O = "\uf1c8";
inline const char* ICON_FILE_CODE_O = "\uf1c9";
inline const char* ICON_VINE = "\uf1ca";
inline const char* ICON_CODEPEN = "\uf1cb";
inline const char* ICON_JSFIDDLE = "\uf1cc";
inline const char* ICON_LIFE_RING = "\uf1cd";
inline const char* ICON_CIRCLE_O_NOTCH = "\uf1ce";
inline const char* ICON_REBEL = "\uf1d0";
inline const char* ICON_EMPIRE = "\uf1d1";
inline const char* ICON_GIT_SQUARE = "\uf1d2";
inline const char* ICON_GIT = "\uf1d3";
inline const char* ICON_HACKER_NEWS = "\uf1d4";
inline const char* ICON_TENCENT_WEIBO = "\uf1d5";
inline const char* ICON_QQ = "\uf1d6";
inline const char* ICON_WEIXIN = "\uf1d7";
inline const char* ICON_PAPER_PLANE = "\uf1d8";
inline const char* ICON_PAPER_PLANE_O = "\uf1d9";
inline const char* ICON_HISTORY = "\uf1da";
inline const char* ICON_CIRCLE_THIN = "\uf1db";
inline const char* ICON_HEADER = "\uf1dc";
inline const char* ICON_PARAGRAPH = "\uf1dd";
inline const char* ICON_SLIDERS = "\uf1de";
inline const char* ICON_SHARE_ALT = "\uf1e0";
inline const char* ICON_SHARE_ALT_SQUARE = "\uf1e1";
inline const char* ICON_BOMB = "\uf1e2";
inline const char* ICON_FUTBOL_O = "\uf1e3";
inline const char* ICON_TTY = "\uf1e4";
inline const char* ICON_BINOCULARS = "\uf1e5";
inline const char* ICON_PLUG = "\uf1e6";
inline const char* ICON_SLIDESHARE = "\uf1e7";
inline const char* ICON_TWITCH = "\uf1e8";
inline const char* ICON_YELP = "\uf1e9";
inline const char* ICON_NEWSPAPER_O = "\uf1ea";
inline const char* ICON_WIFI = "\uf1eb";
inline const char* ICON_CALCULATOR = "\uf1ec";
inline const char* ICON_PAYPAL = "\uf1ed";
inline const char* ICON_GOOGLE_WALLET = "\uf1ee";
inline const char* ICON_CC_VISA = "\uf1f0";
inline const char* ICON_CC_MASTERCARD = "\uf1f1";
inline const char* ICON_CC_DISCOVER = "\uf1f2";
inline const char* ICON_CC_AMEX = "\uf1f3";
inline const char* ICON_CC_PAYPAL = "\uf1f4";
inline const char* ICON_CC_STRIPE = "\uf1f5";
inline const char* ICON_BELL_SLASH = "\uf1f6";
inline const char* ICON_BELL_SLASH_O = "\uf1f7";
inline const char* ICON_TRASH = "\uf1f8";
inline const char* ICON_COPYRIGHT = "\uf1f9";
inline const char* ICON_AT = "\uf1fa";
inline const char* ICON_EYEDROPPER = "\uf1fb";
inline const char* ICON_PAINT_BRUSH = "\uf1fc";
inline const char* ICON_BIRTHDAY_CAKE = "\uf1fd";
inline const char* ICON_AREA_CHART = "\uf1fe";
inline const char* ICON_PIE_CHART = "\uf200";
inline const char* ICON_LINE_CHART = "\uf201";
inline const char* ICON_LASTFM = "\uf202";
inline const char* ICON_LASTFM_SQUARE = "\uf203";
inline const char* ICON_TOGGLE_OFF = "\uf204";
inline const char* ICON_TOGGLE_ON = "\uf205";
inline const char* ICON_BICYCLE = "\uf206";
inline const char* ICON_BUS = "\uf207";
inline const char* ICON_IOXHOST = "\uf208";
inline const char* ICON_ANGELLIST = "\uf209";
inline const char* ICON_CC = "\uf20a";
inline const char* ICON_ILS = "\uf20b";
inline const char* ICON_MEANPATH = "\uf20c";
inline const char* ICON_BUYSELLADS = "\uf20d";
inline const char* ICON_CONNECTDEVELOP = "\uf20e";
inline const char* ICON_DASHCUBE = "\uf210";
inline const char* ICON_FORUMBEE = "\uf211";
inline const char* ICON_LEANPUB = "\uf212";
inline const char* ICON_SELLSY = "\uf213";
inline const char* ICON_SHIRTSINBULK = "\uf214";
inline const char* ICON_SIMPLYBUILT = "\uf215";
inline const char* ICON_SKYATLAS = "\uf216";
inline const char* ICON_CART_PLUS = "\uf217";
inline const char* ICON_CART_ARROW_DOWN = "\uf218";
inline const char* ICON_DIAMOND = "\uf219";
inline const char* ICON_SHIP = "\uf21a";
inline const char* ICON_USER_SECRET = "\uf21b";
inline const char* ICON_MOTORCYCLE = "\uf21c";
inline const char* ICON_STREET_VIEW = "\uf21d";
inline const char* ICON_HEARTBEAT = "\uf21e";
inline const char* ICON_VENUS = "\uf221";
inline const char* ICON_MARS = "\uf222";
inline const char* ICON_MERCURY = "\uf223";
inline const char* ICON_TRANSGENDER = "\uf224";
inline const char* ICON_TRANSGENDER_ALT = "\uf225";
inline const char* ICON_VENUS_DOUBLE = "\uf226";
inline const char* ICON_MARS_DOUBLE = "\uf227";
inline const char* ICON_VENUS_MARS = "\uf228";
inline const char* ICON_MARS_STROKE = "\uf229";
inline const char* ICON_MARS_STROKE_V = "\uf22a";
inline const char* ICON_MARS_STROKE_H = "\uf22b";
inline const char* ICON_NEUTER = "\uf22c";
inline const char* ICON_GENDERLESS = "\uf22d";
inline const char* ICON_FACEBOOK_OFFICIAL = "\uf230";
inline const char* ICON_PINTEREST_P = "\uf231";
inline const char* ICON_WHATSAPP = "\uf232";
inline const char* ICON_SERVER = "\uf233";
inline const char* ICON_USER_PLUS = "\uf234";
inline const char* ICON_USER_TIMES = "\uf235";
inline const char* ICON_BED = "\uf236";
inline const char* ICON_VIACOIN = "\uf237";
inline const char* ICON_TRAIN = "\uf238";
inline const char* ICON_SUBWAY = "\uf239";
inline const char* ICON_MEDIUM = "\uf23a";
inline const char* ICON_MEDIUM_SQUARE = "\uf2f8";
inline const char* ICON_Y_COMBINATOR = "\uf23b";
inline const char* ICON_OPTIN_MONSTER = "\uf23c";
inline const char* ICON_OPENCART = "\uf23d";
inline const char* ICON_EXPEDITEDSSL = "\uf23e";
inline const char* ICON_BATTERY_FULL = "\uf240";
inline const char* ICON_BATTERY_THREE_QUARTERS = "\uf241";
inline const char* ICON_BATTERY_HALF = "\uf242";
inline const char* ICON_BATTERY_QUARTER = "\uf243";
inline const char* ICON_BATTERY_EMPTY = "\uf244";
inline const char* ICON_MOUSE_POINTER = "\uf245";
inline const char* ICON_I_CURSOR = "\uf246";
inline const char* ICON_OBJECT_GROUP = "\uf247";
inline const char* ICON_OBJECT_UNGROUP = "\uf248";
inline const char* ICON_STICKY_NOTE = "\uf249";
inline const char* ICON_STICKY_NOTE_O = "\uf24a";
inline const char* ICON_CC_JCB = "\uf24b";
inline const char* ICON_CC_DINERS_CLUB = "\uf24c";
inline const char* ICON_CLONE = "\uf24d";
inline const char* ICON_BALANCE_SCALE = "\uf24e";
inline const char* ICON_HOURGLASS_O = "\uf250";
inline const char* ICON_HOURGLASS_START = "\uf251";
inline const char* ICON_HOURGLASS_HALF = "\uf252";
inline const char* ICON_HOURGLASS_END = "\uf253";
inline const char* ICON_HOURGLASS = "\uf254";
inline const char* ICON_HAND_ROCK_O = "\uf255";
inline const char* ICON_HAND_PAPER_O = "\uf256";
inline const char* ICON_HAND_SCISSORS_O = "\uf257";
inline const char* ICON_HAND_LIZARD_O = "\uf258";
inline const char* ICON_HAND_SPOCK_O = "\uf259";
inline const char* ICON_HAND_POINTER_O = "\uf25a";
inline const char* ICON_HAND_PEACE_O = "\uf25b";
inline const char* ICON_TRADEMARK = "\uf25c";
inline const char* ICON_REGISTERED = "\uf25d";
inline const char* ICON_CREATIVE_COMMONS = "\uf25e";
inline const char* ICON_GG = "\uf260";
inline const char* ICON_GG_CIRCLE = "\uf261";
inline const char* ICON_TRIPADVISOR = "\uf262";
inline const char* ICON_ODNOKLASSNIKI = "\uf263";
inline const char* ICON_ODNOKLASSNIKI_SQUARE = "\uf264";
inline const char* ICON_GET_POCKET = "\uf265";
inline const char* ICON_WIKIPEDIA_W = "\uf266";
inline const char* ICON_SAFARI = "\uf267";
inline const char* ICON_CHROME = "\uf268";
inline const char* ICON_FIREFOX = "\uf269";
inline const char* ICON_OPERA = "\uf26a";
inline const char* ICON_INTERNET_EXPLORER = "\uf26b";
inline const char* ICON_TELEVISION = "\uf26c";
inline const char* ICON_CONTAO = "\uf26d";
inline const char* ICON_500PX = "\uf26e";
inline const char* ICON_AMAZON = "\uf270";
inline const char* ICON_CALENDAR_PLUS_O = "\uf271";
inline const char* ICON_CALENDAR_MINUS_O = "\uf272";
inline const char* ICON_CALENDAR_TIMES_O = "\uf273";
inline const char* ICON_CALENDAR_CHECK_O = "\uf274";
inline const char* ICON_INDUSTRY = "\uf275";
inline const char* ICON_MAP_PIN = "\uf276";
inline const char* ICON_MAP_SIGNS = "\uf277";
inline const char* ICON_MAP_O = "\uf278";
inline const char* ICON_MAP = "\uf279";
inline const char* ICON_COMMENTING = "\uf27a";
inline const char* ICON_COMMENTING_O = "\uf27b";
inline const char* ICON_HOUZZ = "\uf27c";
inline const char* ICON_VIMEO = "\uf27d";
inline const char* ICON_BLACK_TIE = "\uf27e";
inline const char* ICON_FONTICONS = "\uf280";
inline const char* ICON_REDDIT_ALIEN = "\uf281";
inline const char* ICON_EDGE = "\uf282";
inline const char* ICON_CREDIT_CARD_ALT = "\uf283";
inline const char* ICON_CODIEPIE = "\uf284";
inline const char* ICON_MODX = "\uf285";
inline const char* ICON_FORT_AWESOME = "\uf286";
inline const char* ICON_USB = "\uf287";
inline const char* ICON_PRODUCT_HUNT = "\uf288";
inline const char* ICON_MIXCLOUD = "\uf289";
inline const char* ICON_SCRIBD = "\uf28a";
inline const char* ICON_PAUSE_CIRCLE = "\uf28b";
inline const char* ICON_PAUSE_CIRCLE_O = "\uf28c";
inline const char* ICON_STOP_CIRCLE = "\uf28d";
inline const char* ICON_STOP_CIRCLE_O = "\uf28e";
inline const char* ICON_SHOPPING_BAG = "\uf290";
inline const char* ICON_SHOPPING_BASKET = "\uf291";
inline const char* ICON_HASHTAG = "\uf292";
inline const char* ICON_BLUETOOTH = "\uf293";
inline const char* ICON_BLUETOOTH_B = "\uf294";
inline const char* ICON_PERCENT = "\uf295";
inline const char* ICON_GITLAB = "\uf296";
inline const char* ICON_WPBEGINNER = "\uf297";
inline const char* ICON_WPFORMS = "\uf298";
inline const char* ICON_ENVIRA = "\uf299";
inline const char* ICON_UNIVERSAL_ACCESS = "\uf29a";
inline const char* ICON_WHEELCHAIR_ALT = "\uf29b";
inline const char* ICON_QUESTION_CIRCLE_O = "\uf29c";
inline const char* ICON_BLIND = "\uf29d";
inline const char* ICON_AUDIO_DESCRIPTION = "\uf29e";
inline const char* ICON_VOLUME_CONTROL_PHONE = "\uf2a0";
inline const char* ICON_BRAILLE = "\uf2a1";
inline const char* ICON_ASSISTIVE_LISTENING_SYSTEMS = "\uf2a2";
inline const char* ICON_AMERICAN_SIGN_LANGUAGE_INTERPRETING = "\uf2a3";
inline const char* ICON_DEAF = "\uf2a4";
inline const char* ICON_GLIDE = "\uf2a5";
inline const char* ICON_GLIDE_G = "\uf2a6";
inline const char* ICON_SIGN_LANGUAGE = "\uf2a7";
inline const char* ICON_LOW_VISION = "\uf2a8";
inline const char* ICON_VIADEO = "\uf2a9";
inline const char* ICON_VIADEO_SQUARE = "\uf2aa";
inline const char* ICON_SNAPCHAT = "\uf2ab";
inline const char* ICON_SNAPCHAT_GHOST = "\uf2ac";
inline const char* ICON_SNAPCHAT_SQUARE = "\uf2ad";
inline const char* ICON_FIRST_ORDER = "\uf2b0";
inline const char* ICON_YOAST = "\uf2b1";
inline const char* ICON_THEMEISLE = "\uf2b2";
inline const char* ICON_GOOGLE_PLUS_OFFICIAL = "\uf2b3";
inline const char* ICON_FONT_AWESOME = "\uf2b4";
inline const char* ICON_HANDSHAKE_O = "\uf2b5";
inline const char* ICON_ENVELOPE_OPEN = "\uf2b6";
inline const char* ICON_ENVELOPE_OPEN_O = "\uf2b7";
inline const char* ICON_LINODE = "\uf2b8";
inline const char* ICON_ADDRESS_BOOK = "\uf2b9";
inline const char* ICON_ADDRESS_BOOK_O = "\uf2ba";
inline const char* ICON_ADDRESS_CARD = "\uf2bb";
inline const char* ICON_ADDRESS_CARD_O = "\uf2bc";
inline const char* ICON_USER_CIRCLE = "\uf2bd";
inline const char* ICON_USER_CIRCLE_O = "\uf2be";
inline const char* ICON_USER_O = "\uf2c0";
inline const char* ICON_ID_BADGE = "\uf2c1";
inline const char* ICON_ID_CARD = "\uf2c2";
inline const char* ICON_ID_CARD_O = "\uf2c3";
inline const char* ICON_QUORA = "\uf2c4";
inline const char* ICON_FREE_CODE_CAMP = "\uf2c5";
inline const char* ICON_TELEGRAM = "\uf2c6";
inline const char* ICON_THERMOMETER_FULL = "\uf2c7";
inline const char* ICON_THERMOMETER_THREE_QUARTERS = "\uf2c8";
inline const char* ICON_THERMOMETER_HALF = "\uf2c9";
inline const char* ICON_THERMOMETER_QUARTER = "\uf2ca";
inline const char* ICON_THERMOMETER_EMPTY = "\uf2cb";
inline const char* ICON_SHOWER = "\uf2cc";
inline const char* ICON_BATH = "\uf2cd";
inline const char* ICON_PODCAST = "\uf2ce";
inline const char* ICON_WINDOW_MAXIMIZE = "\uf2d0";
inline const char* ICON_WINDOW_MINIMIZE = "\uf2d1";
inline const char* ICON_WINDOW_RESTORE = "\uf2d2";
inline const char* ICON_WINDOW_CLOSE = "\uf2d3";
inline const char* ICON_WINDOW_CLOSE_O = "\uf2d4";
inline const char* ICON_BANDCAMP = "\uf2d5";
inline const char* ICON_GRAV = "\uf2d6";
inline const char* ICON_ETSY = "\uf2d7";
inline const char* ICON_IMDB = "\uf2d8";
inline const char* ICON_RAVELRY = "\uf2d9";
inline const char* ICON_EERCAST = "\uf2da";
inline const char* ICON_MICROCHIP = "\uf2db";
inline const char* ICON_SNOWFLAKE_O = "\uf2dc";
inline const char* ICON_SUPERPOWERS = "\uf2dd";
inline const char* ICON_WPEXPLORER = "\uf2de";
inline const char* ICON_MEETUP = "\uf2e0";
inline const char* ICON_MASTODON = "\uf2e1";
inline const char* ICON_MASTODON_ALT = "\uf2e2";
inline const char* ICON_FORK_AWESOME = "\uf2e3";
inline const char* ICON_PEERTUBE = "\uf2e4";
inline const char* ICON_DIASPORA = "\uf2e5";
inline const char* ICON_FRIENDICA = "\uf2e6";
inline const char* ICON_GNU_SOCIAL = "\uf2e7";
inline const char* ICON_LIBERAPAY_SQUARE = "\uf2e8";
inline const char* ICON_LIBERAPAY = "\uf2e9";
inline const char* ICON_SCUTTLEBUTT = "\uf2ea";
inline const char* ICON_HUBZILLA = "\uf2eb";
inline const char* ICON_SOCIAL_HOME = "\uf2ec";
inline const char* ICON_ARTSTATION = "\uf2ed";
inline const char* ICON_DISCORD = "\uf2ee";
inline const char* ICON_DISCORD_ALT = "\uf2ef";
inline const char* ICON_PATREON = "\uf2f0";
inline const char* ICON_SNOWDRIFT = "\uf2f1";
inline const char* ICON_ACTIVITYPUB = "\uf2f2";
inline const char* ICON_ETHEREUM = "\uf2f3";
inline const char* ICON_KEYBASE = "\uf2f4";
inline const char* ICON_SHAARLI = "\uf2f5";
inline const char* ICON_SHAARLI_O = "\uf2f6";
inline const char* ICON_KEY_MODERN = "\uf2f7";
inline const char* ICON_XMPP = "\uf2f9";
inline const char* ICON_ARCHIVE_ORG = "\uf2fc";
inline const char* ICON_FREEDOMBOX = "\uf2fd";
inline const char* ICON_FACEBOOK_MESSENGER = "\uf2fe";
inline const char* ICON_DEBIAN = "\uf2ff";
inline const char* ICON_MASTODON_SQUARE = "\uf300";
inline const char* ICON_TIPEEE = "\uf301";
inline const char* ICON_REACT = "\uf302";
inline const char* ICON_DOGMAZIC = "\uf303";
inline const char* ICON_NEXTCLOUD = "\uf306";
inline const char* ICON_NEXTCLOUD_SQUARE = "\uf307";
} // namespace Icon

View File

@ -1,82 +0,0 @@
#pragma once
#include "imgui.h"
#include "icons.hpp"
#include "fonts.hpp"
namespace try_engine::style
{
inline void init()
{
/* use this - https://www.unknowncheats.me/forum/c-and-c-/189635-imgui-style-settings.html */
ImGuiStyle& st = ImGui::GetStyle();
st.WindowPadding = ImVec2(5.0f, 5.0f);
st.WindowRounding = 0.0f;
st.FramePadding = ImVec2(5.0f, 5.0f);
st.FrameRounding = 0.0f;
st.ItemSpacing = ImVec2(8.0f, 8.0f);
st.ItemInnerSpacing = ImVec2(8.0f, 6.0f);
st.IndentSpacing = 25.0f;
st.ScrollbarSize = 12.0f;
st.ScrollbarRounding = 0.0f;
st.GrabMinSize = 5.0f;
st.GrabRounding = 0.0f;
st.TabRounding = 0.0f;
st.WindowBorderSize = 0.0f;
st.ChildRounding = 0.0f;
st.PopupRounding = 0.0f;
st.PopupBorderSize = 0.0f;
st.WindowMenuButtonPosition = ImGuiDir_None;
/* tab */
st.Colors[ImGuiCol_Tab] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
st.Colors[ImGuiCol_TabHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_TabActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
/* title */
st.Colors[ImGuiCol_TitleBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
st.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
st.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
st.Colors[ImGuiCol_Text] = ImVec4(0.80f, 0.80f, 0.83f, 1.00f);
st.Colors[ImGuiCol_TextDisabled] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
st.Colors[ImGuiCol_ChildBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
st.Colors[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
st.Colors[ImGuiCol_Border] = ImVec4(0.80f, 0.80f, 0.83f, 0.88f);
st.Colors[ImGuiCol_BorderShadow] = ImVec4(0.92f, 0.91f, 0.88f, 0.00f);
st.Colors[ImGuiCol_FrameBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
st.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
st.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
st.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
st.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
st.Colors[ImGuiCol_CheckMark] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
st.Colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
st.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
st.Colors[ImGuiCol_Button] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
st.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_ButtonActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_Header] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
st.Colors[ImGuiCol_Separator] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_SeparatorHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_SeparatorActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
st.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
st.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
st.Colors[ImGuiCol_PlotLines] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
st.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
st.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
st.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
st.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.25f, 1.00f, 0.00f, 0.43f);
st.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(1.00f, 0.98f, 0.95f, 0.73f);
st.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
fonts::init();
};
};

View File

@ -1,27 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
#include "try_engine/event/system_event/event.hpp"
namespace try_engine
{
class layer
{
using time = time::timestep<float>;
public:
layer() = default;
virtual ~layer() = default;
layer(const layer&) = delete;
layer(layer&) = delete;
public:
virtual void on_attach() {};
virtual void on_detach() {};
virtual void gui_render() {};
virtual void on_event(system_event::event&) {};
virtual void on_event(std::any, std::any) {};
};
}

View File

@ -1,32 +0,0 @@
headers = [
'application/application.hpp',
'window/window.hpp',
'window/graphic_context/graphic_context.hpp',
'renderer/renderer.hpp',
'renderer/texture/texture.hpp',
'gui/gui.hpp',
]
sources = [
'application/application.cpp',
'window/window.cpp',
'window/graphic_context/graphic_context.cpp',
'renderer/renderer.cpp',
'renderer/texture/texture.cpp',
'gui/gui.cpp',
]
lib = library(
'try_engine',
include_directories : inc,
sources: [headers, sources],
dependencies : deps,
cpp_args: args
)
try_engine_dep = declare_dependency(
include_directories: inc,
link_with: lib,
)
deps += try_engine_dep

View File

@ -1,14 +0,0 @@
#include "renderer.hpp"
namespace try_engine
{
void renderer::set_color(const glm::vec4& color)
{
glClearColor(color.r, color.g, color.b, color.a);
}
void renderer::clear()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
}

View File

@ -1,22 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
/*
renderer - некий объект отрисовки и разукраски всей сцены.
Т.е. в нем все компоненты, которые нужны для создания на сцене чего-либо:
шейдера, шейдерные программы, буфера вершин, вспомогательные функции установки цвета и его очистки и т.п.
Может использоваться в разных частях программы, где нужно что-то создать и отрисовать или перекрасить и удалить.
Относимся к этому, как к набору кисточек и ластиков при помощи которых что-то делаем на экране, рисуем или стираем.
*/
namespace try_engine
{
class renderer
{
public:
static void set_color(const glm::vec4&);
static void clear();
};
}

View File

@ -1,32 +0,0 @@
#include "texture.hpp"
namespace try_engine
{
texture::~texture()
{
glDeleteTextures(1, &m_texture_id);
}
void texture::make()
{
if (!m_texture_id)
{
glGenTextures(1, &m_texture_id);
glBindTexture(GL_TEXTURE_2D, m_texture_id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
}
}
void texture::clear()
{
glDeleteTextures(1, &m_texture_id);
}
void texture::draw(ImVec2 pos, ImVec2 size)
{
// ImGui::Image(reinterpret_cast<void*>(static_cast<intptr_t>(texture)), ImVec2(pos.x + 100, pos.y + 100));
ImGui::GetWindowDrawList()->AddImage(reinterpret_cast<void*>(static_cast<intptr_t>(m_texture_id)), pos, size);
}
}

View File

@ -1,31 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
namespace try_engine
{
class texture
{
public:
texture() = default;
~texture();
private:
GLuint m_texture_id = 0;
public:
template<typename Image>
void bind(Image& image)
{
// HERE наяинаем тут
// возможно эту штуку нужно делать сразу полсе make
// либо перенеси ее в make
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.cols, image.rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.data);
}
void draw(ImVec2 pos, ImVec2 size);
void make();
void clear();
};
}

View File

@ -1,17 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
#include "try_engine/gui/gui.hpp"
#include "try_engine/gui/style/style.hpp"
#include "try_engine/application/application.hpp"
#include "try_engine/event/system_event/classificator.hpp"
#include "try_engine/event/system_event/event.hpp"
#include "try_engine/event/system_event/category/key_event.hpp"
#include "try_engine/event/system_event/category/window_event.hpp"
#include "try_engine/event/app_event/event.hpp"
#include "try_engine/renderer/renderer.hpp"
#include "try_engine/renderer/texture/texture.hpp"

View File

@ -1,85 +0,0 @@
#pragma once
#define BIT(x)\
(1 << x)
#define EVENT_CLASS_TYPE_FN(type)\
virtual std::string get_name() const override { return type; }
#define BIND_EVENT_FN(app, x)\
std::bind(&app::x, this, std::placeholders::_1)
#define BASE_TYPE_DEFINE()\
using time = try_engine::time::timestep<float>;\
using event_manager = try_engine::app_event::event;\
using system_event = try_engine::system_event::event;\
using win = try_engine::win
#define BASE_WINDOW_FLAGS()\
if (m_flags.m_no_titlebar) m_window_flags |= ImGuiWindowFlags_NoTitleBar;\
if (m_flags.m_no_scrollbar) m_window_flags |= ImGuiWindowFlags_NoScrollbar;\
if (!m_flags.m_no_menu) m_window_flags |= ImGuiWindowFlags_MenuBar;\
if (m_flags.m_no_move) m_window_flags |= ImGuiWindowFlags_NoMove;\
if (m_flags.m_no_resize) m_window_flags |= ImGuiWindowFlags_NoResize;\
if (m_flags.m_no_collapse) m_window_flags |= ImGuiWindowFlags_NoCollapse;\
if (m_flags.m_no_nav) m_window_flags |= ImGuiWindowFlags_NoNav;\
if (m_flags.m_no_background) m_window_flags |= ImGuiWindowFlags_NoBackground;\
if (m_flags.m_no_bring_to_front) m_window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus
#define SET_EVENT_MANAGER_IMPL()\
void set_event_manager(event_manager* in_event_manager)\
{\
m_event_manager = in_event_manager;\
m_event_manager->set_event_callback(this);\
}
#define BASE_OVERIDE_IMPL()\
void on_attach() override;\
void on_detach() override;\
void gui_render() override;\
void on_event(system_event& e) override;\
void on_event(std::any type, std::any value) override
#define CONSTRUCT_IMPL(name)\
name() : try_engine::layer() { BASE_WINDOW_FLAGS(); };\
~name() = default
#define FLAGS_STRUCT_DEFINED()\
struct flags\
{\
bool m_p_open = false;\
bool m_no_titlebar = true;\
bool m_no_scrollbar = true;\
bool m_no_menu = true;\
bool m_no_move = true;\
bool m_no_resize = true;\
bool m_no_collapse = true;\
bool m_no_nav = false;\
bool m_no_background = false;\
bool m_no_bring_to_front = false;\
bool m_no_docking = true;\
} m_flags;\
ImGuiWindowFlags m_window_flags = 0
#define BASE_IMPL(name)\
BASE_TYPE_DEFINE();\
public:\
CONSTRUCT_IMPL(name);\
public:\
BASE_OVERIDE_IMPL();\
public:\
SET_EVENT_MANAGER_IMPL();\
private:\
FLAGS_STRUCT_DEFINED();\
private:\
event_manager* m_event_manager;\
win m_win
#define BEGIN_IMGUI_WIN() if (!ImGui::Begin(m_win.m_name.c_str(), &m_flags.m_p_open, m_window_flags)) ImGui::End()
#define END_IMGUI_WIN() ImGui::End()
#define TR_PUSH_FONT(def_font, def_size)\
ImGui::PushFont(try_engine::style::fonts::get_font(try_engine::style::fonts::font_type::def_font, def_size))
#define TR_POP_FONT() ImGui::PopFont()

View File

@ -1,20 +0,0 @@
#pragma once
#include <opencv2/opencv.hpp>
#include <functional>
#include <memory>
#include <string>
#include <any>
#include <map>
#include <thread>
#define GLFW_INCLUDE_NONE
#include "GLFW/glfw3.h"
#include "glad.h"
#include "glm/glm.hpp"
#include "hack/logger/logger.hpp"
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
#include "nlohmann/json.hpp"

View File

@ -1,122 +0,0 @@
#pragma once
#include <stdint.h>
namespace try_engine::key
{
enum : uint16_t
{
// из glfw3.h
SPACE = 32,
APOSTROPHE = 39, /* ' */
COMMA = 44, /* , */
MINUS = 45, /* - */
PERIOD = 46, /* . */
SLASH = 47, /* / */
D0 = 48, /* 0 */
D1 = 49, /* 1 */
D2 = 50, /* 2 */
D3 = 51, /* 3 */
D4 = 52, /* 4 */
D5 = 53, /* 5 */
D6 = 54, /* 6 */
D7 = 55, /* 7 */
D8 = 56, /* 8 */
D9 = 57, /* 9 */
SEMICOLON = 59, /* ; */
EQUAL = 61, /* = */
A = 65,
B = 66,
C = 67,
D = 68,
E = 69,
F = 70,
G = 71,
H = 72,
I = 73,
J = 74,
K = 75,
L = 76,
M = 77,
N = 78,
O = 79,
P = 80,
Q = 81,
R = 82,
S = 83,
T = 84,
U = 85,
V = 86,
W = 87,
X = 88,
Y = 89,
Z = 90,
LEFTBRACKET = 91, /* [ */
BACKSLASH = 92, /* \ */
RIGHTBRACKET = 93, /* ] */
GRAVEACCENT = 96, /* ` */
WORLD1 = 161, /* non-US #1 */
WORLD2 = 162, /* non-US #2 */
ESCAPE = 256,
ENTER = 257,
TAB = 258,
BACKSPACE = 259,
INSERT = 260,
DELETE = 261,
RIGHT = 262,
LEFT = 263,
DOWN = 264,
UP = 265,
PAGEUP = 266,
PAGEDOWN = 267,
HOME = 268,
END = 269,
CAPSLOCK = 280,
SCROLLLOCK = 281,
NUMLOCK = 282,
PRINTSCREEN = 283,
PAUSE = 284,
F1 = 290,
F2 = 291,
F3 = 292,
F4 = 293,
F5 = 294,
F6 = 295,
F7 = 296,
F8 = 297,
F9 = 298,
F10 = 299,
F11 = 300,
F12 = 301,
F13 = 302,
F14 = 303,
F15 = 304,
F16 = 305,
F17 = 306,
F18 = 307,
F19 = 308,
F20 = 309,
F21 = 310,
F22 = 311,
F23 = 312,
F24 = 313,
F25 = 314,
LEFTSHIFT = 340,
LEFTCONTROL = 341,
LEFTALT = 342,
LEFTSUPER = 343,
RIGHTSHIFT = 344,
RIGHTCONTROL = 345,
RIGHTALT = 346,
RIGHTSUPER = 347,
MENU = 348
};
}

View File

@ -1,35 +0,0 @@
#pragma once
#include "using.hpp"
namespace try_engine::time
{
template<typename Time>
class timestep
{
public:
timestep(Time data_ = 0.0f) : data { data_ } {}
operator Time() const { return data; }
Time get_seconds() const { return data; }
Time get_milliseconds() const { return data * 1000.0f; }
private:
Time data;
};
}
namespace try_engine::time
{
inline timestep<float> get_time()
{
static float frame_time = 0.0f;
float t = (float)glfwGetTime();
timestep<float> ts = t - frame_time;
frame_time = t;
return ts;
}
}

View File

@ -1,14 +0,0 @@
#pragma once
#include "include.hpp"
namespace try_engine
{
template<typename Event>
using event_callback = std::function<void(Event&)>;
using JSON = nlohmann::json;
}

View File

@ -1,5 +0,0 @@
#pragma once
#include "keycode.hpp"
#include "define.hpp"
#include "time.hpp"

View File

@ -1,27 +0,0 @@
#include "graphic_context.hpp"
namespace try_engine
{
graphic_context::graphic_context(GLFWwindow* w) : m_win { w } {}
void graphic_context::init()
{
glfwMakeContextCurrent(m_win);
int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
hack::log(": ")("Glad loader status", status == 1 ? "true" : "false");
hack::log(": ")("OpenGL Info");
hack::log(": ")(" Vendor", glGetString(GL_VENDOR));
hack::log(": ")(" Renderer", glGetString(GL_RENDERER));
hack::log(": ")(" Version", glGetString(GL_VERSION));
hack::log(": ")(" GLSL Version", glGetString(GL_SHADING_LANGUAGE_VERSION));
glfwSwapInterval(1);
}
void graphic_context::swap_buffers()
{
glfwSwapBuffers(m_win);
}
}

View File

@ -1,19 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
namespace try_engine
{
class graphic_context
{
public:
graphic_context(GLFWwindow*);
private:
GLFWwindow* m_win;
public:
void init();
void swap_buffers();
};
}

View File

@ -1,205 +0,0 @@
#include "window.hpp"
#include "renderer/renderer.hpp"
#include "event/system_event/category/key_event.hpp"
#include "event/system_event/category/window_event.hpp"
namespace try_engine
{
window::window(std::string app_name)
{
if (!glfwInit())
exit(EXIT_FAILURE);
m_window_data.m_name = app_name;
set_hint();
set_window();
set_context();
set_pointer();
set_key_callback();
set_window_callback();
hack::log(": ")("Creating window", m_window_data.m_name);
hack::log(" = ")("w", m_window_data.m_width);
hack::log(" = ")("h", m_window_data.m_height);
}
window::~window()
{
glfwDestroyWindow(m_win);
glfwTerminate();
hack::warn(": ")("destroy", "window", m_window_data.m_name);
}
void window::set_hint()
{
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_SAMPLES, 4);
}
void window::set_window()
{
m_win = glfwCreateWindow(
glfwGetVideoMode(glfwGetPrimaryMonitor())->width,
glfwGetVideoMode(glfwGetPrimaryMonitor())->height,
m_window_data.m_name.c_str(),
nullptr, nullptr
);
if(m_win == NULL)
{
hack::error()("Failed to create GLFW window");
glfwTerminate();
exit(EXIT_FAILURE);
}
glfwGetWindowSize(m_win, &m_window_data.m_width, &m_window_data.m_height);
}
void window::set_context()
{
m_graphic_context = std::make_unique<graphic_context>(m_win);
m_graphic_context->init();
}
void window::set_pointer()
{
glfwSetWindowUserPointer(m_win, &m_window_data);
}
void window::set_event_callback(const event_callback<system_event::event>& cb)
{
m_window_data.on_callback = cb;
}
GLFWwindow* window::glfw_window() const
{
return m_win;
}
int window::width() const
{
return m_window_data.m_width;
}
int window::height() const
{
return m_window_data.m_height;
}
void window::update()
{
glfwPollEvents();
m_graphic_context->swap_buffers();
}
void window::clear() const
{
renderer::set_color({ 0.1f, 0.1f, 0.1f, 1 });
renderer::clear();
}
void window::set_key_callback()
{
glfwSetKeyCallback(m_win, [](GLFWwindow* w, int key, int scancode, int action, int mods)
{
auto data = static_cast<window_data*>(glfwGetWindowUserPointer(w));
switch (action)
{
case GLFW_PRESS:
{
system_event::key_pressed_event e { key };
data->on_callback(e);
break;
}
case GLFW_RELEASE:
{
system_event::key_released_event e { key };
data->on_callback(e);
break;
}
case GLFW_REPEAT:
{
system_event::key_pressed_event e { key };
data->on_callback(e);
break;
}
}
});
// HERE
// это нужнореализовать и в событиях
// там есть классы которые нужно разобрать и привести в порядок
//
// glfwSetMouseButtonCallback(win, [](GLFWwindow* window, int button, int action, int mods)
// {
// auto data = static_cast<window_data*>(glfwGetWindowUserPointer(w));
//
// switch (action)
// {
// case GLFW_PRESS:
// {
// system_event::mouse_button_pressed_event e { button };
// data->callback(e);
// break;
// }
// case GLFW_RELEASE:
// {
// MouseButtonReleasedEvent event{button};
// data.EventCallback(event);
// break;
// }
// }
// });
// glfwSetScrollCallback(win, [](GLFWwindow* window, double xOffset, double yOffset)
// {
// WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
//
// MouseScrolledEvent event{(float)xOffset, (float)yOffset};
// data.EventCallback(event);
// });
//
// glfwSetCursorPosCallback(win, [](GLFWwindow* window, double xPos, double yPos)
// {
// WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
//
// MouseMovedEvent event{(float)xPos, (float)yPos};
// data.EventCallback(event);
// });
}
void window::set_window_callback()
{
glfwSetWindowSizeLimits(m_win, m_window_data.m_width, m_window_data.m_height, GLFW_DONT_CARE, GLFW_DONT_CARE);
glfwSetWindowSizeCallback(m_win, [](GLFWwindow* w, int width, int height)
{
auto data = static_cast<window_data*>(glfwGetWindowUserPointer(w));
data->m_width = width;
data->m_height = height;
system_event::window_resize_event e { width, height };
data->on_callback(e);
});
glfwSetWindowCloseCallback(m_win, [](GLFWwindow* w)
{
auto data = static_cast<window_data*>(glfwGetWindowUserPointer(w));
system_event::window_close_event e;
data->on_callback(e);
});
glfwSetWindowFocusCallback(m_win, [](GLFWwindow* w, int focused)
{
auto data = static_cast<window_data*>(glfwGetWindowUserPointer(w));
system_event::window_focus_event e { focused };
data->on_callback(e);
});
}
}

View File

@ -1,50 +0,0 @@
#pragma once
#include "try_engine/utils/utils.hpp"
#include "graphic_context/graphic_context.hpp"
#include "try_engine/event/system_event/event.hpp"
namespace try_engine
{
class window
{
public:
window(std::string);
~window();
// HERE
// реализовать остальные конструкторы
private:
// ни каких unique_ptr тут неполучится
// т.к. glfwCreateWindow maloc-ом выделяет память
// что не есть хорошо для умных указателей
GLFWwindow* m_win;
std::unique_ptr<graphic_context> m_graphic_context;
struct window_data
{
std::string m_name;
int m_width, m_height;
event_callback<system_event::event> on_callback;
} m_window_data;
public:
void update();
GLFWwindow* glfw_window() const;
void clear() const ;
int width() const;
int height() const;
void set_event_callback(const event_callback<system_event::event>&);
void set_window_callback();
private:
void set_hint();
void set_window();
void set_context();
void set_pointer();
void set_key_callback();
};
}

View File

@ -1,11 +0,0 @@
# gtest_proj = subproject('gtest')
# gtest_dep = gtest_proj.get_variable('gtest_main_dep')
#
# test(
# 'hello',
# executable(
# 'hello',
# 'hello.cpp',
# dependencies: [ hello_dep, gtest_dep ]
# )
# )

View File

@ -48,9 +48,10 @@ lib = library(
cpp_args: args cpp_args: args
) )
try_engine_dep = declare_dependency( vertex_engine_dep = declare_dependency(
include_directories: inc, include_directories: inc,
link_with: lib, link_with: lib,
) )
deps += try_engine_dep deps += vertex_engine_dep