diff --git a/qtquick3d.pro b/qtquick3d.pro
index e3dd94d..d054a48 100644
--- a/qtquick3d.pro
+++ b/qtquick3d.pro
@@ -1,5 +1,4 @@
 requires(!watchos)
 requires(qtHaveModule(quick))
-requires(qtConfig(opengl))
 
 load(qt_parts)
diff --git a/src/quick3d/qquick3dscenerenderer.cpp b/src/quick3d/qquick3dscenerenderer.cpp
index e742cfb..93c43a5 100644
--- a/src/quick3d/qquick3dscenerenderer.cpp
+++ b/src/quick3d/qquick3dscenerenderer.cpp
@@ -56,6 +56,7 @@ static bool dumpRenderTimes = false;
 
 namespace {
 void cleanupOpenGLState() {
+#if QT_CONFIG(opengl)
     QOpenGLFunctions *gl = QOpenGLContext::currentContext()->functions();
 
     gl->glBindBuffer(GL_ARRAY_BUFFER, 0);
@@ -71,6 +72,7 @@ void cleanupOpenGLState() {
     gl->glUseProgram(0);
 
     QOpenGLFramebufferObject::bindDefault();
+#endif
 }
 
 }
@@ -143,12 +145,13 @@ void SGFramebufferObjectNode::render()
 
         markDirty(QSGNode::DirtyMaterial);
         emit textureChanged();
-
+#if QT_CONFIG(opengl)
         if (renderer->renderStats()) {
             if (dumpRenderTimes)
                 QOpenGLContext::currentContext()->functions()->glFinish();
             renderer->renderStats()->endRender(dumpRenderTimes);
         }
+#endif
         if (renderer->m_sgContext->renderer()->rendererRequestsFrames()
                 || requestedFramesCount > 0) {
             scheduleRender();
@@ -173,15 +176,16 @@ QQuick3DSceneRenderer::QQuick3DSceneRenderer(QWindow *window)
     , m_antialiasingFbo(nullptr)
     , m_fbo(nullptr)
 {
-    QOpenGLContext *openGLContext = QOpenGLContext::currentContext();
-
     // There is only one Render context per window, so check if one exists for this window already
     m_sgContext = QSSGRenderContextInterface::getRenderContextInterface(quintptr(window));
 
+#if QT_CONFIG(opengl)
     // If there was no render context, then set it up for this window
-    if (m_sgContext.isNull())
+    if (m_sgContext.isNull()) {
+        QOpenGLContext *openGLContext = QOpenGLContext::currentContext();
         m_sgContext = QSSGRenderContextInterface::getRenderContextInterface(QSSGRenderContext::createGl(openGLContext->format()), QString::fromLatin1("./"), quintptr(window));
-
+    }
+#endif
 
     dumpPerfTiming = (qEnvironmentVariableIntValue("QT_QUICK3D_DUMP_PERFTIMERS") > 0);
     dumpRenderTimes = (qEnvironmentVariableIntValue("QT_QUICK3D_DUMP_RENDERTIMES") > 0);
@@ -595,11 +599,13 @@ void QQuick3DSGRenderNode::render(const QSGRenderNode::RenderState *state)
     // reset some state
     cleanupOpenGLState();
 
+#if QT_CONFIG(opengl)
     if (renderer->renderStats()) {
         if (dumpRenderTimes)
             QOpenGLContext::currentContext()->functions()->glFinish();
         renderer->renderStats()->endRender(dumpRenderTimes);
     }
+#endif
     if (renderer->m_sgContext->renderer()->rendererRequestsFrames())
         window->update();
 }
diff --git a/src/render/glg/qssgglimplobjects_p.h b/src/render/glg/qssgglimplobjects_p.h
index c4b27b1..19fe344 100644
--- a/src/render/glg/qssgglimplobjects_p.h
+++ b/src/render/glg/qssgglimplobjects_p.h
@@ -42,7 +42,6 @@
 // We mean it.
 //
 
-#include <QtQuick3DRender/private/qssgopenglutil_p.h>
 #include <QtQuick3DRender/private/qssgrendertexture2d_p.h>
 
 QT_BEGIN_NAMESPACE
diff --git a/src/render/qssgrendercontext_p.h b/src/render/qssgrendercontext_p.h
index 1dfb2c9..46a43a7 100644
--- a/src/render/qssgrendercontext_p.h
+++ b/src/render/qssgrendercontext_p.h
@@ -47,9 +47,11 @@
 #include <QtQuick3DRender/private/qtquick3drenderglobal_p.h>
 #include <QtQuick3DRender/private/qssgrenderbasetypes_p.h>
 #include <QtQuick3DRender/private/qssgglimplobjects_p.h>
-#include <QtQuick3DRender/private/qssgrenderbackendgles2_p.h>
-#include <QtQuick3DRender/private/qssgrenderbackendgl3_p.h>
-#include <QtQuick3DRender/private/qssgrenderbackendgl4_p.h>
+#if QT_CONFIG(opengl)
+#  include <QtQuick3DRender/private/qssgrenderbackendgles2_p.h>
+#  include <QtQuick3DRender/private/qssgrenderbackendgl3_p.h>
+#  include <QtQuick3DRender/private/qssgrenderbackendgl4_p.h>
+#endif
 #include <QtQuick3DRender/private/qssgrenderbackendnull_p.h>
 #include <QtQuick3DRender/private/qssgrendervertexbuffer_p.h>
 #include <QtQuick3DRender/private/qssgrenderindexbuffer_p.h>
diff --git a/src/render/qssgrendershaderprogram.cpp b/src/render/qssgrendershaderprogram.cpp
index a32434f..6317fed 100644
--- a/src/render/qssgrendershaderprogram.cpp
+++ b/src/render/qssgrendershaderprogram.cpp
@@ -36,6 +36,10 @@
 
 #include <limits>
 
+#if !QT_CONFIG(opengl)
+using GLfloat = float;
+#endif
+
 QT_BEGIN_NAMESPACE
 
 template<typename TDataType>
diff --git a/src/render/render.pro b/src/render/render.pro
index 083064c..8de15bb 100644
--- a/src/render/render.pro
+++ b/src/render/render.pro
@@ -1,8 +1,9 @@
 TARGET = QtQuick3DRender
 MODULE = quick3drender
 
-QT += quick3dutils-private openglextensions quick
-
+QT += quick3dutils-private quick
+qtConfig(opengl): QT += openglextensions
+s
 DEFINES += QT_BUILD_QUICK3DRENDER_LIB
 
 HEADERS += \
@@ -14,16 +15,6 @@ HEADERS += \
     qssgrenderdatabuffer_p.h \
     qssgrenderdepthstencilstate_p.h \
     qssgrenderframebuffer_p.h \
-    backends/gl/qssgrenderbackendgles2_p.h \
-    backends/gl/qssgopenglextensions_p.h \
-    backends/gl/qssgopengltokens_p.h \
-    backends/gl/qssgopenglutil_p.h \
-    backends/gl/qssgrenderbackendgl3_p.h \
-    backends/gl/qssgrenderbackendgl4_p.h \
-    backends/gl/qssgrenderbackendglbase_p.h \
-    backends/gl/qssgrenderbackendinputassemblergl_p.h \
-    backends/gl/qssgrenderbackendrenderstatesgl_p.h \
-    backends/gl/qssgrenderbackendshaderprogramgl_p.h \
     backends/software/qssgrenderbackendnull_p.h \
     backends/qssgrenderbackend_p.h \
     glg/qssgglimplobjects_p.h \
@@ -46,12 +37,6 @@ HEADERS += \
     qtquick3drenderglobal_p.h
 
 SOURCES += \
-    backends/gl/qssgopenglextensions.cpp \
-    backends/gl/qssgrenderbackendgles2.cpp \
-    backends/gl/qssgrenderbackendgl3.cpp \
-    backends/gl/qssgrenderbackendgl4.cpp \
-    backends/gl/qssgrenderbackendglbase.cpp \
-    backends/gl/qssgrendercontextgl.cpp \
     backends/software/qssgrenderbackendnull.cpp \
     qssgrenderattriblayout.cpp \
     qssgrenderconstantbuffer.cpp \
@@ -77,4 +62,26 @@ SOURCES += \
     qssgrenderlogging.cpp \
     qssgrendershaderconstant.cpp
 
+qtConfig(opengl) {
+    HEADERS += \
+        backends/gl/qssgrenderbackendgles2_p.h \
+        backends/gl/qssgopenglextensions_p.h \
+        backends/gl/qssgopengltokens_p.h \
+        backends/gl/qssgopenglutil_p.h \
+        backends/gl/qssgrenderbackendgl3_p.h \
+        backends/gl/qssgrenderbackendgl4_p.h \
+        backends/gl/qssgrenderbackendglbase_p.h \
+        backends/gl/qssgrenderbackendinputassemblergl_p.h \
+        backends/gl/qssgrenderbackendrenderstatesgl_p.h \
+        backends/gl/qssgrenderbackendshaderprogramgl_p.h
+
+    SOURCES += \
+        backends/gl/qssgopenglextensions.cpp \
+        backends/gl/qssgrenderbackendgles2.cpp \
+        backends/gl/qssgrenderbackendgl3.cpp \
+        backends/gl/qssgrenderbackendgl4.cpp \
+        backends/gl/qssgrenderbackendglbase.cpp \
+        backends/gl/qssgrendercontextgl.cpp
+}
+
 load(qt_module)
diff --git a/src/runtimerender/resourcemanager/qssgrenderbuffermanager.cpp b/src/runtimerender/resourcemanager/qssgrenderbuffermanager.cpp
index d53d2c1..395e404 100644
--- a/src/runtimerender/resourcemanager/qssgrenderbuffermanager.cpp
+++ b/src/runtimerender/resourcemanager/qssgrenderbuffermanager.cpp
@@ -195,12 +195,14 @@ QSSGRenderImageTextureData QSSGBufferManager::loadRenderImage(const QString &inI
         }
     } else if (inLoadedImage->compressedData.isValid()) {
         // Compressed Texture Image handling using QTextureFileData
+#if QT_CONFIG(opengl)
         for (int i = 0; i < inLoadedImage->compressedData.numLevels(); i++) {
             QSize imageSize = sizeForMipLevel(i, inLoadedImage->compressedData.size());
             auto format = GLConversion::fromGLtoTextureFormat(inLoadedImage->compressedData.glInternalFormat());
             theTexture->setTextureData(QSSGByteView(reinterpret_cast<quint8 *>(inLoadedImage->compressedData.data().data() + inLoadedImage->compressedData.dataOffset(i)), inLoadedImage->compressedData.dataLength(i)),
                                        i, imageSize.width(), imageSize.height(), format);
         }
+#endif
     }
 
 
