OpenSceneGraph/include/osgQt/QWidgetImage
Robert Osfield 5597248895 Introduced new scheme for setting up which version of OpenGL/OpenGL ES the OSG is compiled for.
To select standard OpenGL 1/2 build with full backwards and forwards comtability use:

  ./configure
  make

OR

  ./configure -DOPENGL_PROFILE=GL2

To select OpenGL 3 core profile build using GL3/gl3.h header:

  ./configure -DOPENGL_PROFILE=GL3

To select OpenGL Arb core profile build using GL/glcorearb.h header:

  ./configure -DOPENGL_PROFILE=GLCORE

To select OpenGL ES 1.1 profile use:

  ./configure -DOPENGL_PROFILE=GLES1

To select OpenGL ES 2 profile use:

  ./configure -DOPENGL_PROFILE=GLES2


Using OPENGL_PROFILE will select all the appropriate features required so no other settings in cmake will need to be adjusted.
The new configuration options are stored in the include/osg/OpenGL header that deprecates the old include/osg/GL header.
2014-04-23 09:08:26 +00:00

58 lines
1.6 KiB
C++

/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef QWIDGETIMAGE
#define QWIDGETIMAGE
#include <osgQt/QGraphicsViewAdapter>
#include <osg/Image>
namespace osgQt
{
class OSGQT_EXPORT QWidgetImage : public osg::Image
{
public:
QWidgetImage( QWidget* widget=0 );
QWidget* getQWidget() { return _widget; }
QGraphicsViewAdapter* getQGraphicsViewAdapter() { return _adapter; }
void clearWriteBuffer();
void render();
/// Overridden scaleImage used to catch cases where the image is
/// fullscreen and the window is resized.
virtual void scaleImage(int s,int t,int r, GLenum newDataType);
virtual bool sendFocusHint(bool focus);
virtual bool sendPointerEvent(int x, int y, int buttonMask);
virtual bool sendKeyEvent(int key, bool keyDown);
virtual void setFrameLastRendered(const osg::FrameStamp* frameStamp);
protected:
QPointer<QGraphicsViewAdapter> _adapter;
QPointer<QWidget> _widget;
};
}
#endif