summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-09-07 12:50:04 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-11-23 20:56:05 +0000
commitdcda5a7c3d042a3d6cfe87351258644e4f2153d2 (patch)
treef9440888f5e278b2827e8ad8678d1d20e6f80728 /src
parent575c7fabe06816557ad6e27b2bfaf3c429c68b92 (diff)
GraphicsContext: add an isInitialized() getter
Allows to determine if the graphics context has been initialized. Change-Id: I2710e62658aae86a9a0de2532cc1acbdab983abc Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/render/graphicshelpers/graphicscontext.cpp5
-rw-r--r--src/render/graphicshelpers/graphicscontext_p.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp
index 9ee88b7c2..2713de85b 100644
--- a/src/render/graphicshelpers/graphicscontext.cpp
+++ b/src/render/graphicshelpers/graphicscontext.cpp
@@ -421,6 +421,11 @@ bool GraphicsContext::hasValidGLHelper() const
return m_glHelper != nullptr;
}
+bool GraphicsContext::isInitialized() const
+{
+ return m_initialized;
+}
+
bool GraphicsContext::makeCurrent(QSurface *surface)
{
Q_ASSERT(m_gl);
diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h
index d8f861ebb..9f7a0f972 100644
--- a/src/render/graphicshelpers/graphicscontext_p.h
+++ b/src/render/graphicshelpers/graphicscontext_p.h
@@ -126,6 +126,7 @@ public:
void doneCurrent();
void activateGLHelper();
bool hasValidGLHelper() const;
+ bool isInitialized() const;
QOpenGLShaderProgram *createShaderProgram(Shader *shaderNode);
void loadShader(Shader* shader);