67 lines
1.8 KiB
C++
67 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include "log.h"
|
|
#include "shader.h"
|
|
#include "shape.h"
|
|
#include "texture.h"
|
|
#include "layout.h"
|
|
#include "font.h"
|
|
|
|
class App
|
|
{
|
|
public:
|
|
static App I;
|
|
std::string data_path{ "." };
|
|
Sampler sampler;
|
|
Texture2D tex;
|
|
LayoutManager layout;
|
|
NodeMessageBox* msgbox;
|
|
NodeSettings* settings;
|
|
NodePopupMenu* popup = nullptr;
|
|
NodePopupMenu* menu_file = nullptr;
|
|
NodePopupMenu* menu_edit = nullptr;
|
|
NodePopupMenu* menu_layers = nullptr;
|
|
NodeBorder* sidebar = nullptr;
|
|
std::shared_ptr<NodePanelBrush> brushes;
|
|
std::shared_ptr<NodePanelLayer> layers;
|
|
std::shared_ptr<NodePanelColor> color;
|
|
std::shared_ptr<NodePanelStroke> stroke;
|
|
NodeCanvas* canvas;
|
|
Node* current_panel = nullptr;
|
|
Node* panels;
|
|
std::function<void(int)> on_brush_select;
|
|
std::function<void(glm::vec4 color)> on_color_change;
|
|
std::function<void()> on_stroke_change;
|
|
const uint16_t main_id = const_hash("main");
|
|
float width;
|
|
float height;
|
|
glm::vec2 gesture_p0;
|
|
glm::vec2 gesture_p1;
|
|
#ifdef __ANDROID__
|
|
float zoom = 3.0;
|
|
#else
|
|
float zoom = 1.0;
|
|
#endif // __ANDROID__
|
|
void initLog();
|
|
void init();
|
|
void initShaders();
|
|
void initAssets();
|
|
void initLayout();
|
|
void create();
|
|
void terminate();
|
|
void clear();
|
|
void update(float dt);
|
|
void resize(float w, float h);
|
|
bool mouse_down(int button, float x, float y);
|
|
bool mouse_move(float x, float y);
|
|
bool mouse_up(int button, float x, float y);
|
|
bool mouse_scroll(float x, float y, float delta);
|
|
bool mouse_cancel(int button);
|
|
bool gesture_start(const glm::vec2& p0, const glm::vec2& p1);
|
|
bool gesture_move(const glm::vec2& p0, const glm::vec2& p1);
|
|
bool gesture_end();
|
|
bool key_down(kKey key);
|
|
bool key_up(kKey key);
|
|
bool key_char(char key);
|
|
};
|