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"
78 void beginPaintSession(
105 bool isOpenGLPainting()
const;
110 {
return myCurOpenGLDrawable; }
113 void dumpState()
const;
121 #if UT_ASSERT_LEVEL > 0
123 void assertGLStateForRender()
const;
127 void restoreGLStateForRender()
const;
130 void saveGLStateForQPainter();
133 void restoreGLStateForQPainter();
152 int myOpenGLModeLevel = 0;
168 int paint_area_x,
int paint_area_y,
int paint_area_w,
int paint_area_h);
181 int paint_area_x,
int paint_area_y,
182 int paint_area_w,
int paint_area_h);
192 bool isForUIViewport()
const;
200 void toPainterPosition(
int &
x,
int &
y,
int w=0,
int h=0)
const;
207 void toUIPosition(
int &x,
int &y,
int w=0,
int h=0)
const;
222 {
return myPaintState; }
226 {
return myPaintState->painter(); }
230 {
return myPaintState->paintArea(); }
235 { myPaintState->toPainterPosition(x, y,
w,
h); }
240 { myPaintState->toUIPosition(x, y,
w,
h); }
269 bool mySwitchedToQPainterMode =
false;
285 bool mySwitchedToOpenGLMode =
false;
296 const QSurfaceFormat &format, QWidget *parent,
297 QOpenGLContext *sharedContext);
326 void initializeGL()
override;
327 void paintGL()
override;
328 void resizeGL(
int w,
int h)
override;
329 void paintEvent(QPaintEvent *e)
override;
330 void showEvent(QShowEvent *
event)
override;
334 const QSurfaceFormat *format, QOpenGLContext *shared_context=
nullptr);
336 QOpenGLContext *myInitializedContext =
nullptr;
339 bool myIsPainting =
false;
340 bool myNeedsOwnerUpdate =
false;
348 #endif // __RE_WINDOWDRAWABLE_H_INCLUDED__
int samples() const
Multisample sample count this drawable was created with (-1 if none).
RE_OpenGLDrawable * currentOpenGLDrawable() const
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