Commit b1a33a49 authored by Matthias Möller's avatar Matthias Möller

- fix snapshot and video function for win32 with qt5

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17188 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 435f1255
......@@ -102,12 +102,19 @@
#include <QGraphicsWidget>
#include <QGraphicsGridLayout>
#include <QGraphicsProxyWidget>
#include <QGLFramebufferObjectFormat>
#include <QPainter>
#include <QPaintEngine>
#include <QImageWriter>
#if QT_VERSION < 0x050000
#include <QGLFramebufferObject>
#else // QT_VERSION > 0x050000
#undef QT_NO_OPENGL
#include <QOpenGLFramebufferObject>
#define QT_NO_OPENGL
#endif //QT_VERSION < 0x050000
#ifdef max
# undef max
#endif
......@@ -2051,16 +2058,15 @@ void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bo
glstate_->viewport(0, 0, w, h);
}
QGLFramebufferObjectFormat format;
QFramebufferObjectFormat format;
format.setInternalTextureFormat(GL_RGBA);
format.setTextureTarget(GL_TEXTURE_2D);
// set the attachments as in the standard rendering
format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
format.setAttachment(QFramebufferObject::CombinedDepthStencil);
// 16 samples per pixel as we want a nice snapshot. If this is not supported
// it will fall back to the maximal supported number of samples
format.setSamples(samples);
QGLFramebufferObject fb( w, h, format);
QFramebufferObject fb(w,h,format);
if ( fb.isValid() ){
......
......@@ -117,8 +117,10 @@ class QtShiftPopupMenu;
class CursorPainter;
#if QT_VERSION < 0x050000
class QGLFramebufferObject;
class QGLFramebufferObjectFormat;
#else
class QOpenGLFramebufferObject;
class QOpenGLFramebufferObjectFormat;
#endif
......@@ -810,13 +812,15 @@ private:
private:
#if QT_VERSION < 0x050000
typedef QGLFramebufferObject QFrameBufferObject;
typedef QGLFramebufferObjectFormat QFramebufferObjectFormat;
typedef QGLFramebufferObject QFramebufferObject;
#else
typedef QOpenGLFramebufferObject QFrameBufferObject;
typedef QOpenGLFramebufferObjectFormat QFramebufferObjectFormat;
typedef QOpenGLFramebufferObject QFramebufferObject;
#endif
/// Framebuffer object that holds the pick cache
QFrameBufferObject* pickCache_;
QFramebufferObject* pickCache_;
/// Should the pick cache be updated
bool updatePickCache_;
......
......@@ -142,7 +142,7 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
// create a new pick cache frambuffer object
if (!pickCache_)
{
pickCache_ = new QFrameBufferObject (glWidth (), glHeight (), QFrameBufferObject::Depth);
pickCache_ = new QFramebufferObject (glWidth (), glHeight (), QFramebufferObject::Depth);
if (!pickCache_->isValid ())
{
pickCacheSupported_ = false;
......@@ -541,7 +541,7 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
// create a new pick cache frambuffer object
if (!pickCache_)
{
pickCache_ = new QFrameBufferObject (glWidth (), glHeight (), QFrameBufferObject::Depth);
pickCache_ = new QFramebufferObject (glWidth (), glHeight (), QFramebufferObject::Depth);
if (!pickCache_->isValid ())
{
pickCacheSupported_ = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment