12 #ifndef hifi_OffscreenGLCanvas_h
13 #define hifi_OffscreenGLCanvas_h
19 class QOffscreenSurface;
20 class QOpenGLDebugMessage;
23 class OffscreenGLCanvas :
public QObject {
27 void setFormat(
const QSurfaceFormat& format);
28 bool create(QOpenGLContext* sharedContext =
nullptr);
31 void moveToThreadWithContext(QThread* thread);
32 QOpenGLContext* getContext() {
35 QObject* getContextObject();
37 void setThreadContext();
38 static bool restoreThreadContext();
41 void clearThreadContext();
43 std::once_flag _reportOnce;
44 QOpenGLContext* _context{
nullptr };
45 QOffscreenSurface* _offscreenSurface{
nullptr };