11 #ifndef __RE_WINDOWDRAWABLE_H_INCLUDED__
12 #define __RE_WINDOWDRAWABLE_H_INCLUDED__
25 #include <QtOpenGLWidgets/QOpenGLWidget>
27 #include <QtWidgets/QOpenGLWidget>
29 #include <QtWidgets/QStylePainter>
38 #define RE_WINDOW_DRAWABLE_OBJ_NAME "RE_WindowDrawable"
39 #define RE_WINDOW_DRAWABLE_SURFACE_OBJ_NAME \
40 RE_WINDOW_DRAWABLE_OBJ_NAME "Window"
41 #define RE_WINDOW_DRAWABLE_WRAPPER_OBJ_NAME \
42 RE_WINDOW_DRAWABLE_OBJ_NAME "Wrapper"
76 void beginPaintSession(
103 bool isOpenGLPainting()
const;
109 void dumpState()
const;
117 #if UT_ASSERT_LEVEL > 0
119 void assertGLStateForRender()
const;
123 void restoreGLStateForRender()
const;
126 void saveGLStateForQPainter();
129 void restoreGLStateForQPainter();
144 int myOpenGLModeLevel = 0;
160 int paint_area_x,
int paint_area_y,
int paint_area_w,
int paint_area_h);
173 int paint_area_x,
int paint_area_y,
174 int paint_area_w,
int paint_area_h);
184 bool isForUIViewport()
const;
192 void toPainterPosition(
int &
x,
int &
y,
int w=0,
int h=0)
const;
199 void toUIPosition(
int &x,
int &y,
int w=0,
int h=0)
const;
214 {
return myPaintState; }
218 {
return myPaintState->painter(); }
222 {
return myPaintState->paintArea(); }
227 { myPaintState->toPainterPosition(x, y,
w,
h); }
232 { myPaintState->toUIPosition(x, y,
w,
h); }
260 bool mySwitchedToQPainterMode =
false;
276 bool mySwitchedToOpenGLMode =
false;
287 const QSurfaceFormat &format, QWidget *parent,
288 QOpenGLContext *sharedContext);
317 void initializeGL()
override;
318 void paintGL()
override;
319 void resizeGL(
int w,
int h)
override;
320 void paintEvent(QPaintEvent *e)
override;
321 void showEvent(QShowEvent *
event)
override;
325 const QSurfaceFormat *format, QOpenGLContext *shared_context=
nullptr);
327 QOpenGLContext *myInitializedContext =
nullptr;
330 bool myIsPainting =
false;
331 bool myNeedsOwnerUpdate =
false;
339 #endif // __RE_WINDOWDRAWABLE_H_INCLUDED__
int samples() const
Multisample sample count this drawable was created with (-1 if none).
void toPainterPosition(int &x, int &y, int w=0, int h=0) const
RE_WindowDrawable * currentDrawable() const
==========================================================================
RE_WindowDrawablePaintState * getPaintState()
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
void toUIPosition(int &x, int &y, int w=0, int h=0) const
RE_Render * currentRender() const
static const char * widgetTag()
static const char * widgetWrapperTag()
GLint GLint GLsizei GLint GLenum format
RE_WindowDrawablePaintState * paintState()
Return the underlying paint state.
const UT_DimRect & paintArea() const
Convenience method to access the paint state's paint area.
GLfloat GLfloat GLfloat GLfloat h
#define RE_WINDOW_DRAWABLE_WRAPPER_OBJ_NAME
LeafData & operator=(const LeafData &)=delete
const RE_Window * getREWindow() const
Return the window that the drawable is currently assigned to.
RE_WindowDrawablePainter * painter() const
Convenience method to access the paint state's painter.
Window drawable that uses only QPainter for the new UI path.
GLubyte GLubyte GLubyte GLubyte w
#define RE_WINDOW_DRAWABLE_OBJ_NAME
static const char * drawableSurfaceTag()
re_AutoPaintBlockBase & operator=(const re_AutoPaintBlockBase &src)=delete
#define RE_WINDOW_DRAWABLE_SURFACE_OBJ_NAME