1st installment of tech ENABLE_ENVIRONMENT_MAP

This commit is contained in:
enricoturri1966 2020-05-28 15:27:29 +02:00
parent 4b6bcd7028
commit c63e03c367
11 changed files with 93 additions and 6 deletions

View file

@ -1583,6 +1583,9 @@ struct Plater::priv
Sidebar *sidebar;
Bed3D bed;
Camera camera;
#if ENABLE_ENVIRONMENT_MAP
GLTexture environment_texture;
#endif // ENABLE_ENVIRONMENT_MAP
Mouse3DController mouse3d_controller;
View3D* view3D;
GLToolbar view_toolbar;
@ -2078,7 +2081,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
});
wxGetApp().other_instance_message_handler()->init(this->q);
// collapse sidebar according to saved value
bool is_collapsed = wxGetApp().app_config->get("collapsed_sidebar") == "1";
sidebar->collapse(is_collapsed);
@ -5531,6 +5533,19 @@ Camera& Plater::get_camera()
return p->camera;
}
#if ENABLE_ENVIRONMENT_MAP
void Plater::init_environment_texture()
{
if (p->environment_texture.get_id() == 0)
p->environment_texture.load_from_file(resources_dir() + "/icons/Pmetal_001.png", false, GLTexture::SingleThreaded, false);
}
unsigned int Plater::get_environment_texture_id() const
{
return p->environment_texture.get_id();
}
#endif // ENABLE_ENVIRONMENT_MAP
const Bed3D& Plater::get_bed() const
{
return p->bed;