247
247
GetInverseScreenPerspectiveMatrix(ViewMatrix, ProjectionMatrix, geo.width, geo.height, 0.1f, 1000.0f, DEGTORAD(90));
249
nux::Matrix4 PremultMatrix = ProjectionMatrix * ViewMatrix;
249
nux::Matrix4 const& PremultMatrix = ProjectionMatrix * ViewMatrix;
251
251
std::list<RenderArg>::iterator it;
253
for (it = args.begin(), i = 0; it != args.end(); ++it, i++)
253
for (it = args.begin(), i = 0; it != args.end(); ++it, ++i)
256
256
IconTextureSource* launcher_icon = it->icon;
346
void IconRenderer::UpdateIconTransform(ui::IconTextureSource* icon, nux::Matrix4 ViewProjectionMatrix, nux::Geometry const& geo,
346
void IconRenderer::UpdateIconTransform(ui::IconTextureSource* icon, nux::Matrix4 const& ViewProjectionMatrix, nux::Geometry const& geo,
347
347
float x, float y, float w, float h, float z, ui::IconTextureSource::TransformIndex index)
349
UpdateIconSectionTransform (icon, ViewProjectionMatrix, geo, x, y, w, h, z, x, y, w, h, index);
349
UpdateIconSectionTransform(icon, ViewProjectionMatrix, geo, x, y, w, h, z, x, y, w, h, index);
352
void IconRenderer::UpdateIconSectionTransform(ui::IconTextureSource* icon, nux::Matrix4 ViewProjectionMatrix, nux::Geometry const& geo,
352
void IconRenderer::UpdateIconSectionTransform(ui::IconTextureSource* icon, nux::Matrix4 const& ViewProjectionMatrix, nux::Geometry const& geo,
353
353
float x, float y, float w, float h, float z, float xx, float yy, float ww, float hh, ui::IconTextureSource::TransformIndex index)
355
nux::Vector4 v0 = nux::Vector4(x, y, z, 1.0f);
356
nux::Vector4 v1 = nux::Vector4(x, y + h, z, 1.0f);
357
nux::Vector4 v2 = nux::Vector4(x + w, y + h, z, 1.0f);
358
nux::Vector4 v3 = nux::Vector4(x + w, y, z, 1.0f);
355
nux::Vector4 v0(x, y, z, 1.0f);
356
nux::Vector4 v1(x, y + h, z, 1.0f);
357
nux::Vector4 v2(x + w, y + h, z, 1.0f);
358
nux::Vector4 v3(x + w, y, z, 1.0f);
360
360
v0 = ViewProjectionMatrix * v0;
361
361
v1 = ViewProjectionMatrix * v1;
706
704
void IconRenderer::RenderElement(nux::GraphicsEngine& GfxContext,
707
705
RenderArg const& arg,
708
nux::ObjectPtr<nux::IOpenGLBaseTexture> icon,
709
nux::Color bkg_color,
706
nux::ObjectPtr<nux::IOpenGLBaseTexture> const& icon,
707
nux::Color const& bkg_color,
708
nux::Color const& colorify,
712
710
bool force_filter,
713
std::vector<nux::Vector4>& xform_coords)
711
std::vector<nux::Vector4> const& xform_coords)
715
713
if (icon.IsNull())
718
if (nux::Abs(arg.x_rotation) < 0.01f &&
719
nux::Abs(arg.y_rotation) < 0.01f &&
720
nux::Abs(arg.z_rotation) < 0.01f &&
716
if (std::abs(arg.x_rotation) < 0.01f &&
717
std::abs(arg.y_rotation) < 0.01f &&
718
std::abs(arg.z_rotation) < 0.01f &&
722
721
icon->SetFiltering(GL_NEAREST, GL_NEAREST);
724
725
icon->SetFiltering(GL_LINEAR, GL_LINEAR);
726
728
nux::Vector4 const& v0 = xform_coords[0];
727
729
nux::Vector4 const& v1 = xform_coords[1];