shows rendered texture of style
This commit is contained in:
parent
bd6a3bc8a2
commit
f75777a948
2 changed files with 14 additions and 5 deletions
|
@ -7,6 +7,11 @@
|
||||||
#include "slic3r/Utils/WxFontUtils.hpp"
|
#include "slic3r/Utils/WxFontUtils.hpp"
|
||||||
#include "slic3r/GUI/3DScene.hpp" // ::glsafe
|
#include "slic3r/GUI/3DScene.hpp" // ::glsafe
|
||||||
|
|
||||||
|
// ability to request new frame after finish rendering
|
||||||
|
#include "slic3r/GUI/GUI_App.hpp"
|
||||||
|
#include "slic3r/GUI/Plater.hpp"
|
||||||
|
#include "slic3r/GUI/GLCanvas3D.hpp"
|
||||||
|
|
||||||
#include "wx/fontenum.h"
|
#include "wx/fontenum.h"
|
||||||
|
|
||||||
#include <boost/log/trivial.hpp>
|
#include <boost/log/trivial.hpp>
|
||||||
|
@ -98,11 +103,6 @@ void CreateFontImageJob::process(Ctl &ctl)
|
||||||
r->encode(encoder);
|
r->encode(encoder);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ability to request new frame after finish rendering
|
|
||||||
#include "slic3r/GUI/GUI_App.hpp"
|
|
||||||
#include "slic3r/GUI/Plater.hpp"
|
|
||||||
#include "slic3r/GUI/GLCanvas3D.hpp"
|
|
||||||
|
|
||||||
void CreateFontImageJob::finalize(bool canceled, std::exception_ptr &)
|
void CreateFontImageJob::finalize(bool canceled, std::exception_ptr &)
|
||||||
{
|
{
|
||||||
if (m_input.count_opened_font_files)
|
if (m_input.count_opened_font_files)
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
|
|
||||||
#include "slic3r/GUI/3DScene.hpp" // ::glsafe
|
#include "slic3r/GUI/3DScene.hpp" // ::glsafe
|
||||||
|
|
||||||
|
// ability to request new frame after finish rendering
|
||||||
|
#include "slic3r/GUI/GUI_App.hpp"
|
||||||
|
#include "slic3r/GUI/Plater.hpp"
|
||||||
|
#include "slic3r/GUI/GLCanvas3D.hpp"
|
||||||
|
|
||||||
using namespace Slic3r;
|
using namespace Slic3r;
|
||||||
using namespace Slic3r::GUI;
|
using namespace Slic3r::GUI;
|
||||||
|
|
||||||
|
@ -126,6 +131,7 @@ void CreateFontStyleImagesJob::process(Ctl &ctl)
|
||||||
|
|
||||||
void CreateFontStyleImagesJob::finalize(bool canceled, std::exception_ptr &)
|
void CreateFontStyleImagesJob::finalize(bool canceled, std::exception_ptr &)
|
||||||
{
|
{
|
||||||
|
if (canceled) return;
|
||||||
// upload texture on GPU
|
// upload texture on GPU
|
||||||
GLuint tex_id;
|
GLuint tex_id;
|
||||||
GLenum target = GL_TEXTURE_2D, format = GL_RGBA, type = GL_UNSIGNED_BYTE;
|
GLenum target = GL_TEXTURE_2D, format = GL_RGBA, type = GL_UNSIGNED_BYTE;
|
||||||
|
@ -150,4 +156,7 @@ void CreateFontStyleImagesJob::finalize(bool canceled, std::exception_ptr &)
|
||||||
// bind default texture
|
// bind default texture
|
||||||
GLuint no_texture_id = 0;
|
GLuint no_texture_id = 0;
|
||||||
glsafe(::glBindTexture(target, no_texture_id));
|
glsafe(::glBindTexture(target, no_texture_id));
|
||||||
|
|
||||||
|
// show rendered texture
|
||||||
|
wxGetApp().plater()->canvas3D()->schedule_extra_frame(0);
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue