16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 22:39:18 +02:00
Files
maszyna/widgets/map.h
2019-02-25 00:41:11 +01:00

54 lines
1.2 KiB
C++

#pragma once
#include "gl/shader.h"
#include "renderer.h"
#include "Texture.h"
#include "uilayer.h"
#include "widgets/map_objects.h"
namespace ui {
class disambiguation_popup {
std::string m_id;
std::vector<map::semaphore> m_list;
public:
disambiguation_popup(std::string &&id, std::vector<map::semaphore> &&list)
: m_id(id), m_list(list) {}
void render();
};
class map_panel : public ui_panel {
std::unique_ptr<gl::program> m_shader;
std::unique_ptr<gl::framebuffer> m_msaa_fb;
std::unique_ptr<gl::renderbuffer> m_msaa_rb;
std::unique_ptr<gl::framebuffer> m_fb;
std::unique_ptr<opengl_texture> m_tex;
std::unique_ptr<gl::ubo> scene_ubo;
gl::scene_ubs scene_ubs;
std::vector<gfx::geometrybank_handle> m_section_handles;
std::vector<gfx::geometrybank_handle> m_switch_handles;
const int fb_size = 1024;
glm::vec2 translate;
float zoom = 1.0f / 1000.0f;
float get_vehicle_rotation();
void render_map_texture(glm::mat4 transform, glm::vec2 surface_size);
void render_labels(glm::mat4 transform, ImVec2 origin, glm::vec2 surface_size);
bool init_done = false;
std::optional<map::semaphore> active;
public:
map_panel();
void render_contents() override;
};
}