16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 14:49:19 +02:00

python screen windows without context sharing

This commit is contained in:
milek7
2019-03-18 17:02:54 +01:00
parent efb041aaa0
commit 99e7ef5513
12 changed files with 156 additions and 54 deletions

View File

@@ -1,23 +1,27 @@
#include "renderer.h"
#include "PyInt.h"
#include <GLFW/glfw3.h>
class python_screen_viewer
{
struct window_config {
GLFWwindow *window;
struct window_state {
GLFWwindow *window = nullptr;
glm::ivec2 size;
glm::vec2 offset;
glm::vec2 scale;
std::unique_ptr<gl::ubo> ubo;
std::unique_ptr<gl::program> shader;
window_state() = default;
~window_state();
};
std::vector<window_config> m_windows;
std::vector<std::unique_ptr<window_state>> m_windows;
GLuint m_source;
std::shared_ptr<python_rt> m_rt;
std::shared_ptr<std::thread> m_renderthread;
std::unique_ptr<gl::program> m_shader;
gl::scene_ubs m_ubs;
std::atomic_bool m_exit = false;
@@ -25,7 +29,7 @@ class python_screen_viewer
void threadfunc();
public:
python_screen_viewer(GLuint src, std::string name);
python_screen_viewer(std::shared_ptr<python_rt> rt, std::string name);
~python_screen_viewer();
void notify_window_size(GLFWwindow *window, int w, int h);