1
0
Fork 0
Univerxel/src/render/UI.hpp

40 lines
940 B
C++
Raw Normal View History

2020-07-06 19:18:29 +00:00
#pragma once
#include "imgui.h"
#include <GL/glew.h>
#include <GLFW/glfw3.h>
2020-07-25 16:45:03 +00:00
#include "../state.h"
2020-07-06 19:18:29 +00:00
namespace UI {
2020-07-25 16:45:03 +00:00
/// Retro actions to state
2020-07-06 19:18:29 +00:00
enum class Actions {
None = 0,
FPS = 1 << 0,
FullScreen = 1 << 1,
2020-07-10 17:49:16 +00:00
ClearColor = 1 << 2,
RendererSharders = 1 << 3,
RendererTextures = 1 << 4,
World = 1 << 5,
2020-07-10 19:37:49 +00:00
Camera = 1 << 6,
2020-07-18 15:42:45 +00:00
ChangeContouring = 1 << 7,
2020-07-06 19:18:29 +00:00
};
inline Actions operator|(Actions a, Actions b) {
return static_cast<Actions>(static_cast<int>(a) | static_cast<int>(b));
}
inline bool operator&&(Actions a, Actions b) {
return static_cast<int>(a) & static_cast<int>(b);
}
2020-07-25 16:45:03 +00:00
/// Prepare UI
2020-07-06 19:18:29 +00:00
void setup(GLFWwindow*);
2020-07-25 16:45:03 +00:00
/// Release UI
2020-07-06 19:18:29 +00:00
void unload();
2020-07-25 16:45:03 +00:00
/// Compute UI
2020-07-06 19:18:29 +00:00
Actions draw(options&, state&, const reports&, GLuint aim);
2020-07-25 16:45:03 +00:00
/// Is UI in focus
2020-07-06 19:18:29 +00:00
bool isFocus();
2020-07-25 16:45:03 +00:00
/// Display UI
2020-07-06 19:18:29 +00:00
void render();
};