11 #ifndef __RE_OPENGLDRAWABLE_H_INCLUDED__
12 #define __RE_OPENGLDRAWABLE_H_INCLUDED__
24 #include <QtGui/QOpenGLContext>
25 #include <QtGui/QSurfaceFormat>
26 #include <QtOpenGL/QOpenGLPaintDevice>
27 #include <QtWidgets/QWidget>
36 #define RE_OPENGL_DRAWABLE_OBJ_NAME "RE_OpenGLDrawable"
37 #define RE_OPENGL_DRAWABLE_SURFACE_OBJ_NAME \
38 RE_OPENGL_DRAWABLE_OBJ_NAME "Window"
39 #define RE_OPENGL_DRAWABLE_WRAPPER_OBJ_NAME \
40 RE_OPENGL_DRAWABLE_OBJ_NAME "Wrapper"
54 const QSurfaceFormat &format, QWidget *parent,
55 QOpenGLContext *sharedContext);
67 QOpenGLContext *context();
81 QPaintDevice *stylePaintDevice();
83 QPaintEngine *
paintEngine()
const override {
return nullptr; };
106 void paintEvent(QPaintEvent *
event)
override;
107 void resizeEvent(QResizeEvent *
event)
override;
108 void showEvent(QShowEvent *
event)
override;
111 void init_(
const QSurfaceFormat *format);
113 void createGLContext_();
117 QSurfaceFormat myFormat;
120 QOpenGLContext *mySharedContext =
nullptr;
121 bool myIsContextInitialized =
false;
123 bool myIsPainting =
false;
124 bool myNeedsOwnerUpdate =
false;
131 #endif // __RE_OPENGLDRAWABLE_H_INCLUDED__
#define RE_OPENGL_DRAWABLE_WRAPPER_OBJ_NAME
==========================================================================
#define RE_OPENGL_DRAWABLE_SURFACE_OBJ_NAME
#define RE_OPENGL_DRAWABLE_OBJ_NAME
int samples() const
Multisample sample count this drawable was created with (-1 if none).
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
GLint GLint GLsizei GLint GLenum format
static const char * widgetWrapperTag()
static const char * widgetTag()
const RE_Window * getREWindow() const
Return the window that the drawable is currently assigned to.
QPaintEngine * paintEngine() const override
static const char * drawableSurfaceTag()