3D info is now using a different rendereing method more compatible with software rendering

p4#: 20669
This commit is contained in:
Jacob Støren
2013-02-28 11:58:31 +01:00
parent 5a84a12864
commit cd0b40ef20
6 changed files with 171 additions and 42 deletions

View File

@@ -43,7 +43,8 @@ public:
TOP_LEFT,
TOP_RIGHT,
BOTTOM_LEFT,
BOTTOM_RIGHT
BOTTOM_RIGHT,
UNMANAGED
};
enum LayoutDirection
@@ -56,10 +57,17 @@ public:
virtual Vec2ui sizeHint() = 0; // In Pixels
virtual Vec2ui maximumSize() = 0; // In Pixels
virtual Vec2ui minimumSize() = 0; // In Pixels
cvf::Vec2i unmanagedPosition() const { return m_unmanagedPosition; }
void setUnmanagedPosition(cvf::Vec2i val) { m_unmanagedPosition = val; }
virtual void render(OpenGLContext* oglContext, const Vec2i& position, const Vec2ui& size) = 0;
virtual void renderSoftware(OpenGLContext* oglContext, const Vec2i& position, const Vec2ui& size) = 0;
virtual bool pick(int oglXCoord, int oglYCoord, const Vec2i& position, const Vec2ui& size);
private:
Vec2i m_unmanagedPosition;
};
}

View File

@@ -308,6 +308,25 @@ void Rendering::renderOverlayItems(OpenGLContext* oglContext, bool useSoftwareRe
item->render(oglContext, rect.min(), Vec2ui(static_cast<cvf::uint>(rect.width()), static_cast<cvf::uint>(rect.height())));
}
}
for (size_t i = 0; i < m_overlayItems.size(); i++)
{
OverlayItemLayout item = m_overlayItems.at(i);
if ((item.corner == OverlayItem::UNMANAGED) )
{
Vec2ui size = item.overlayItem->sizeHint();
Vec2i pos = item.overlayItem->unmanagedPosition();
if (useSoftwareRendering)
{
item.overlayItem->renderSoftware(oglContext, pos, size);
}
else
{
item.overlayItem->render(oglContext, pos, size);
}
}
}
}