11 #ifndef __RE_GLDRAWABLE_H_INCLUDED__
12 #define __RE_GLDRAWABLE_H_INCLUDED__
24 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
25 #include <QtWidgets/QOpenGLWidget>
27 #include <QtGui/QOpenGLContext>
28 #include <QtWidgets/QWidget>
31 #if defined(EXPERIMENTAL_VOLT_STYLE)
32 #include <UI/UI_Look.h>
34 #include <QtGui/QPainter>
44 #define RE_GL_DRAWABLE_OBJ_NAME "RE_GLDrawable"
45 #define RE_GL_DRAWABLE_SURFACE_OBJ_NAME RE_GL_DRAWABLE_OBJ_NAME "Window"
47 #define RE_GL_DRAWABLE_WRAPPER_OBJ_NAME RE_GL_DRAWABLE_OBJ_NAME "Wrapper"
50 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
55 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
59 #if !defined(USE_QT6) && !defined(EXPERIMENTAL_QOPENGLWIDGET)
78 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
90 const QSurfaceFormat &format, QWidget *parent,
91 QOpenGLContext *sharedContext);
94 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
100 QOpenGLContext *
context() {
return myContext.get(); }
120 #if defined(EXPERIMENTAL_VOLT_STYLE)
121 void updatePixmap(UI_Look *look, QPixmap pixmap)
123 for (
int i = 0; i < myPixmapBuffer.size(); i++)
125 if (myPixmapBuffer[i].
first == look)
127 myPixmapBuffer.removeIndex(i);
131 myPixmapBuffer.append(std::make_pair(look, pixmap));
136 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
137 void initializeGL()
override;
138 void paintGL()
override;
139 void resizeGL(
int w,
int h)
override;
150 const QSurfaceFormat *format, QOpenGLContext *shared_context=
nullptr);
155 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
156 QOpenGLContext *myInitializedContext =
nullptr;
159 bool myIsPainting =
false;
168 #if defined(EXPERIMENTAL_VOLT_STYLE)
177 #endif // __RE_GLDRAWABLE_H_INCLUDED__
RE_GLDrawable(const QSurfaceFormat &format)
void setDrawable(RE_GLDrawable *drawable)
static const char * drawableSurfaceTag()
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
static const char * widgetWrapperTag()
~RE_GLDrawable() override
#define RE_GL_DRAWABLE_SURFACE_OBJ_NAME
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 * widgetTag()
RE_GLDrawable * drawable() const
#define RE_GL_DRAWABLE_OBJ_NAME
GLfloat GLfloat GLfloat GLfloat h
void paintEvent(QPaintEvent *event) override
void resizeEvent(QResizeEvent *event) override
QPaintEngine * paintEngine() const override
GLubyte GLubyte GLubyte GLubyte w
#define RE_GL_DRAWABLE_WRAPPER_OBJ_NAME
void mousePressEvent(QMouseEvent *event) override