render implement thread, wrap GL commands into tasks

This commit is contained in:
2019-07-06 22:25:07 +02:00
parent db27334ce5
commit 0012e2ce9b
18 changed files with 1252 additions and 904 deletions

View File

@@ -151,11 +151,14 @@ void NodePanelGrid::init_controls()
m_texture.create_mipmaps();
#else
// get the texture data and resize it
m_texture.bind();
Image img;
img.create(m_texture.size().x, m_texture.size().y);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.m_data.get());
m_texture.unbind();
App::I.render_task([&]
{
m_texture.bind();
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.m_data.get());
m_texture.unbind();
});
Image resized = img.resize(texres, texres);
m_texture.create(resized);
m_texture.create_mipmaps();
@@ -169,9 +172,6 @@ void NodePanelGrid::init_controls()
m_plane.create<1>(1, 1);
TextureManager::load("data/sun.png");
//glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, m_line_range);
//glGetFloatv(GL_ALIASED_LINE_WIDTH_GRANULARITY, &m_line_granularity);
}
int NodePanelGrid::get_samples() const