Change 18603 on 2012/09/11 by fredrik@fredrik_MBP-BootCamp

Added glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); to get proper orientation of textures on point sprites
This commit is contained in:
CeetronResInsight
2012-09-11 09:22:36 +02:00
parent 2bbd48588e
commit b3c142cc9a
21 changed files with 840 additions and 61 deletions

View File

@@ -414,6 +414,9 @@ void caf::Viewer::paintEvent(QPaintEvent* event)
painter.endNativePainting();
#endif
// Call virtual method to allow subclasses to paint on the OpenGlCanvas
this->paintOverlayItems(&painter);
if (m_showPerfInfoHud && isShadersSupported())
{
cvfqt::PerformanceInfoHud hud;
@@ -664,3 +667,12 @@ void caf::Viewer::enableForcedImmediateMode(bool enable)
m_mainRendering->renderEngine()->enableForcedImmediateMode(enable);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int caf::Viewer::currentFrameIndex()
{
if (m_animationControl) return m_animationControl->currentFrame();
else return 0;
}

View File

@@ -112,8 +112,18 @@ public:
public slots:
virtual void slotSetCurrentFrame(int frameIndex);
virtual void slotEndAnimation();
int currentFrameIndex();
protected:
// Method to override if painting directly on the OpenGl Canvas is needed.
virtual void paintOverlayItems(QPainter* painter) {};
// Overridable methods to setup the render system
virtual void setupMainRendering();
virtual void setupRenderingSequence();
virtual void optimizeClippingPlanes();
// Standard overrides. Not for overriding
virtual void resizeGL(int width, int height);
virtual void paintEvent(QPaintEvent* event);
@@ -123,13 +133,6 @@ protected:
m_navigationPolicy;
bool m_navigationPolicyEnabled;
// Overridable methods to setup the render system
virtual void setupMainRendering();
virtual void setupRenderingSequence();
virtual void optimizeClippingPlanes();
void updateCamera(int width, int height);
// Actual rendering objects
cvf::ref<cvf::RenderSequence> m_renderingSequence;
cvf::ref<cvf::Scene> m_mainScene;
@@ -140,6 +143,8 @@ protected:
double m_maxFarPlaneDistance;
private:
void updateCamera(int width, int height);
void releaseOGlResourcesForCurrentFrame();
void debugShowRenderingSequencePartNames();